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/i18n/icu_string_conversions.h" | 9 #include "base/i18n/icu_string_conversions.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 void HttpAuthHandlerDigest::GetRequestMethodAndPath( | 298 void HttpAuthHandlerDigest::GetRequestMethodAndPath( |
299 const HttpRequestInfo* request, | 299 const HttpRequestInfo* request, |
300 std::string* method, | 300 std::string* method, |
301 std::string* path) const { | 301 std::string* path) const { |
302 DCHECK(request); | 302 DCHECK(request); |
303 | 303 |
304 const GURL& url = request->url; | 304 const GURL& url = request->url; |
305 | 305 |
306 if (target_ == HttpAuth::AUTH_PROXY && | 306 if (target_ == HttpAuth::AUTH_PROXY && |
307 (url.SchemeIs("https") || url.SchemeIs("ws") || url.SchemeIs("wss"))) { | 307 (url.SchemeIs("https") || HttpUtil::SchemeIsWsOrWss(url))) { |
308 *method = "CONNECT"; | 308 *method = "CONNECT"; |
309 *path = GetHostAndPort(url); | 309 *path = GetHostAndPort(url); |
310 } else { | 310 } else { |
311 *method = request->method; | 311 *method = request->method; |
312 *path = HttpUtil::PathForRequest(url); | 312 *path = HttpUtil::PathForRequest(url); |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 std::string HttpAuthHandlerDigest::AssembleResponseDigest( | 316 std::string HttpAuthHandlerDigest::AssembleResponseDigest( |
317 const std::string& method, | 317 const std::string& method, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. | 372 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. |
373 authorization += ", qop=" + QopToString(qop_); | 373 authorization += ", qop=" + QopToString(qop_); |
374 authorization += ", nc=" + nc; | 374 authorization += ", nc=" + nc; |
375 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); | 375 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); |
376 } | 376 } |
377 | 377 |
378 return authorization; | 378 return authorization; |
379 } | 379 } |
380 | 380 |
381 } // namespace net | 381 } // namespace net |
OLD | NEW |