| 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 #ifndef NET_HTTP_PROXY_CLIENT_SOCKET_H_ | 5 #ifndef NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| 6 #define NET_HTTP_PROXY_CLIENT_SOCKET_H_ | 6 #define NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 static void BuildTunnelRequest(const HostPortPair& endpoint, | 61 static void BuildTunnelRequest(const HostPortPair& endpoint, |
| 62 const HttpRequestHeaders& auth_headers, | 62 const HttpRequestHeaders& auth_headers, |
| 63 const std::string& user_agent, | 63 const std::string& user_agent, |
| 64 std::string* request_line, | 64 std::string* request_line, |
| 65 HttpRequestHeaders* request_headers); | 65 HttpRequestHeaders* request_headers); |
| 66 | 66 |
| 67 // When an auth challenge (407 response) is received during tunnel | 67 // When an auth challenge (407 response) is received during tunnel |
| 68 // construction/ this method should be called. | 68 // construction/ this method should be called. |
| 69 static int HandleProxyAuthChallenge(HttpAuthController* auth, | 69 static int HandleProxyAuthChallenge(HttpAuthController* auth, |
| 70 HttpResponseInfo* response, | 70 HttpResponseInfo* response, |
| 71 const BoundNetLog& net_log); | 71 const NetLogWithSource& net_log); |
| 72 | 72 |
| 73 // Logs (to the log and in a histogram) a blocked CONNECT response. | 73 // Logs (to the log and in a histogram) a blocked CONNECT response. |
| 74 static void LogBlockedTunnelResponse(int http_response_code, | 74 static void LogBlockedTunnelResponse(int http_response_code, |
| 75 bool is_https_proxy); | 75 bool is_https_proxy); |
| 76 | 76 |
| 77 // When a proxy authentication response is received during tunnel | 77 // When a proxy authentication response is received during tunnel |
| 78 // construction, this method should be called to strip everything | 78 // construction, this method should be called to strip everything |
| 79 // but the auth header from the redirect response. If it returns | 79 // but the auth header from the redirect response. If it returns |
| 80 // false, the response should be discarded and tunnel construction should | 80 // false, the response should be discarded and tunnel construction should |
| 81 // fail. | 81 // fail. |
| 82 static bool SanitizeProxyAuth(HttpResponseInfo* response); | 82 static bool SanitizeProxyAuth(HttpResponseInfo* response); |
| 83 | 83 |
| 84 // When a redirect (e.g. 302 response) is received during tunnel | 84 // When a redirect (e.g. 302 response) is received during tunnel |
| 85 // construction, this method should be called to strip everything | 85 // construction, this method should be called to strip everything |
| 86 // but the Location header from the redirect response. If it returns | 86 // but the Location header from the redirect response. If it returns |
| 87 // false, the response should be discarded and tunnel construction should | 87 // false, the response should be discarded and tunnel construction should |
| 88 // fail. | 88 // fail. |
| 89 static bool SanitizeProxyRedirect(HttpResponseInfo* response); | 89 static bool SanitizeProxyRedirect(HttpResponseInfo* response); |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket); | 92 DISALLOW_COPY_AND_ASSIGN(ProxyClientSocket); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace net | 95 } // namespace net |
| 96 | 96 |
| 97 #endif // NET_HTTP_PROXY_CLIENT_SOCKET_H_ | 97 #endif // NET_HTTP_PROXY_CLIENT_SOCKET_H_ |
| OLD | NEW |