| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 request_headers->SetHeader(HttpRequestHeaders::kHost, host_and_port); | 47 request_headers->SetHeader(HttpRequestHeaders::kHost, host_and_port); |
| 48 request_headers->SetHeader(HttpRequestHeaders::kProxyConnection, | 48 request_headers->SetHeader(HttpRequestHeaders::kProxyConnection, |
| 49 "keep-alive"); | 49 "keep-alive"); |
| 50 if (!user_agent.empty()) | 50 if (!user_agent.empty()) |
| 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( |
| 58 HttpResponseInfo* response, | 58 HttpAuthController* auth, |
| 59 const BoundNetLog& net_log) { | 59 HttpResponseInfo* response, |
| 60 const NetLogWithSource& net_log) { |
| 60 DCHECK(response->headers.get()); | 61 DCHECK(response->headers.get()); |
| 61 int rv = auth->HandleAuthChallenge(response->headers, response->ssl_info, | 62 int rv = auth->HandleAuthChallenge(response->headers, response->ssl_info, |
| 62 false, true, net_log); | 63 false, true, net_log); |
| 63 response->auth_challenge = auth->auth_info(); | 64 response->auth_challenge = auth->auth_info(); |
| 64 if (rv == OK) | 65 if (rv == OK) |
| 65 return ERR_PROXY_AUTH_REQUESTED; | 66 return ERR_PROXY_AUTH_REQUESTED; |
| 66 return rv; | 67 return rv; |
| 67 } | 68 } |
| 68 | 69 |
| 69 // static | 70 // static |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 location.c_str()); | 129 location.c_str()); |
| 129 std::string raw_headers = | 130 std::string raw_headers = |
| 130 HttpUtil::AssembleRawHeaders(fake_response_headers.data(), | 131 HttpUtil::AssembleRawHeaders(fake_response_headers.data(), |
| 131 fake_response_headers.length()); | 132 fake_response_headers.length()); |
| 132 response->headers = new HttpResponseHeaders(raw_headers); | 133 response->headers = new HttpResponseHeaders(raw_headers); |
| 133 | 134 |
| 134 return true; | 135 return true; |
| 135 } | 136 } |
| 136 | 137 |
| 137 } // namespace net | 138 } // namespace net |
| OLD | NEW |