| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_auth_handler_digest.h" | 5 #include "net/http/http_auth_handler_digest.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/md5.h" | 10 #include "base/md5.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 291 } |
| 292 | 292 |
| 293 void HttpAuthHandlerDigest::GetRequestMethodAndPath( | 293 void HttpAuthHandlerDigest::GetRequestMethodAndPath( |
| 294 const HttpRequestInfo* request, | 294 const HttpRequestInfo* request, |
| 295 std::string* method, | 295 std::string* method, |
| 296 std::string* path) const { | 296 std::string* path) const { |
| 297 DCHECK(request); | 297 DCHECK(request); |
| 298 | 298 |
| 299 const GURL& url = request->url; | 299 const GURL& url = request->url; |
| 300 | 300 |
| 301 if (target_ == HttpAuth::AUTH_PROXY && url.SchemeIs("https")) { | 301 if (target_ == HttpAuth::AUTH_PROXY && |
| 302 (url.SchemeIs("https") || url.SchemeIs("httpsv"))) { |
| 302 *method = "CONNECT"; | 303 *method = "CONNECT"; |
| 303 *path = GetHostAndPort(url); | 304 *path = GetHostAndPort(url); |
| 304 } else { | 305 } else { |
| 305 *method = request->method; | 306 *method = request->method; |
| 306 *path = HttpUtil::PathForRequest(url); | 307 *path = HttpUtil::PathForRequest(url); |
| 307 } | 308 } |
| 308 } | 309 } |
| 309 | 310 |
| 310 std::string HttpAuthHandlerDigest::AssembleResponseDigest( | 311 std::string HttpAuthHandlerDigest::AssembleResponseDigest( |
| 311 const std::string& method, | 312 const std::string& method, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. | 367 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. |
| 367 authorization += ", qop=" + QopToString(qop_); | 368 authorization += ", qop=" + QopToString(qop_); |
| 368 authorization += ", nc=" + nc; | 369 authorization += ", nc=" + nc; |
| 369 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); | 370 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); |
| 370 } | 371 } |
| 371 | 372 |
| 372 return authorization; | 373 return authorization; |
| 373 } | 374 } |
| 374 | 375 |
| 375 } // namespace net | 376 } // namespace net |
| OLD | NEW |