| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/proxy_client_socket.h" | 5 #include "net/http/proxy_client_socket.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "net/base/host_port_pair.h" | 9 #include "net/base/host_port_pair.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 request_headers->SetHeader(HttpRequestHeaders::kUserAgent, user_agent); | 51 request_headers->SetHeader(HttpRequestHeaders::kUserAgent, user_agent); |
| 52 | 52 |
| 53 request_headers->MergeFrom(auth_headers); | 53 request_headers->MergeFrom(auth_headers); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // static | 56 // static |
| 57 int ProxyClientSocket::HandleProxyAuthChallenge(HttpAuthController* auth, | 57 int ProxyClientSocket::HandleProxyAuthChallenge(HttpAuthController* auth, |
| 58 HttpResponseInfo* response, | 58 HttpResponseInfo* response, |
| 59 const BoundNetLog& net_log) { | 59 const BoundNetLog& net_log) { |
| 60 DCHECK(response->headers.get()); | 60 DCHECK(response->headers.get()); |
| 61 int rv = auth->HandleAuthChallenge(response->headers, false, true, net_log); | 61 int rv = auth->HandleAuthChallenge(response->headers, response->ssl_info, |
| 62 false, true, net_log); |
| 62 response->auth_challenge = auth->auth_info(); | 63 response->auth_challenge = auth->auth_info(); |
| 63 if (rv == OK) | 64 if (rv == OK) |
| 64 return ERR_PROXY_AUTH_REQUESTED; | 65 return ERR_PROXY_AUTH_REQUESTED; |
| 65 return rv; | 66 return rv; |
| 66 } | 67 } |
| 67 | 68 |
| 68 // static | 69 // static |
| 69 void ProxyClientSocket::LogBlockedTunnelResponse(int http_status_code, | 70 void ProxyClientSocket::LogBlockedTunnelResponse(int http_status_code, |
| 70 bool is_https_proxy) { | 71 bool is_https_proxy) { |
| 71 if (is_https_proxy) { | 72 if (is_https_proxy) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 location.c_str()); | 128 location.c_str()); |
| 128 std::string raw_headers = | 129 std::string raw_headers = |
| 129 HttpUtil::AssembleRawHeaders(fake_response_headers.data(), | 130 HttpUtil::AssembleRawHeaders(fake_response_headers.data(), |
| 130 fake_response_headers.length()); | 131 fake_response_headers.length()); |
| 131 response->headers = new HttpResponseHeaders(raw_headers); | 132 response->headers = new HttpResponseHeaders(raw_headers); |
| 132 | 133 |
| 133 return true; | 134 return true; |
| 134 } | 135 } |
| 135 | 136 |
| 136 } // namespace net | 137 } // namespace net |
| OLD | NEW |