| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 DCHECK(request); | 304 DCHECK(request); |
| 305 | 305 |
| 306 const GURL& url = request->url; | 306 const GURL& url = request->url; |
| 307 | 307 |
| 308 if (target_ == HttpAuth::AUTH_PROXY && | 308 if (target_ == HttpAuth::AUTH_PROXY && |
| 309 (url.SchemeIs("https") || url.SchemeIsWSOrWSS())) { | 309 (url.SchemeIs("https") || url.SchemeIsWSOrWSS())) { |
| 310 *method = "CONNECT"; | 310 *method = "CONNECT"; |
| 311 *path = GetHostAndPort(url); | 311 *path = GetHostAndPort(url); |
| 312 } else { | 312 } else { |
| 313 *method = request->method; | 313 *method = request->method; |
| 314 *path = HttpUtil::PathForRequest(url); | 314 *path = url.PathForRequest(); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 | 317 |
| 318 std::string HttpAuthHandlerDigest::AssembleResponseDigest( | 318 std::string HttpAuthHandlerDigest::AssembleResponseDigest( |
| 319 const std::string& method, | 319 const std::string& method, |
| 320 const std::string& path, | 320 const std::string& path, |
| 321 const AuthCredentials& credentials, | 321 const AuthCredentials& credentials, |
| 322 const std::string& cnonce, | 322 const std::string& cnonce, |
| 323 const std::string& nc) const { | 323 const std::string& nc) const { |
| 324 // ha1 = MD5(A1) | 324 // ha1 = MD5(A1) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. | 374 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. |
| 375 authorization += ", qop=" + QopToString(qop_); | 375 authorization += ", qop=" + QopToString(qop_); |
| 376 authorization += ", nc=" + nc; | 376 authorization += ", nc=" + nc; |
| 377 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); | 377 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); |
| 378 } | 378 } |
| 379 | 379 |
| 380 return authorization; | 380 return authorization; |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace net | 383 } // namespace net |
| OLD | NEW |