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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
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 && url.SchemeIs("https")) { | 306 if (target_ == HttpAuth::AUTH_PROXY && |
| 307 (url.SchemeIs("https") || url.SchemeIs("ws") || url.SchemeIs("wss"))) { |
307 *method = "CONNECT"; | 308 *method = "CONNECT"; |
308 *path = GetHostAndPort(url); | 309 *path = GetHostAndPort(url); |
309 } else { | 310 } else { |
310 *method = request->method; | 311 *method = request->method; |
311 *path = HttpUtil::PathForRequest(url); | 312 *path = HttpUtil::PathForRequest(url); |
312 } | 313 } |
313 } | 314 } |
314 | 315 |
315 std::string HttpAuthHandlerDigest::AssembleResponseDigest( | 316 std::string HttpAuthHandlerDigest::AssembleResponseDigest( |
316 const std::string& method, | 317 const std::string& method, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. | 372 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. |
372 authorization += ", qop=" + QopToString(qop_); | 373 authorization += ", qop=" + QopToString(qop_); |
373 authorization += ", nc=" + nc; | 374 authorization += ", nc=" + nc; |
374 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); | 375 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); |
375 } | 376 } |
376 | 377 |
377 return authorization; | 378 return authorization; |
378 } | 379 } |
379 | 380 |
380 } // namespace net | 381 } // namespace net |
OLD | NEW |