Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: net/http/proxy_client_socket.cc

Issue 982733002: SanitizeProxyAuth: Whitelist all hop-by-hop headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expect specified content-length in BasicAuthProxyKeepAlive test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/proxy_client_socket.cc
diff --git a/net/http/proxy_client_socket.cc b/net/http/proxy_client_socket.cc
index 3c539c6895e295a98f9645070e4258bbf78b5d73..3c0d12d5cb2ada770a0e8114c867a44c1fe059fd 100644
--- a/net/http/proxy_client_socket.cc
+++ b/net/http/proxy_client_socket.cc
@@ -95,9 +95,19 @@ bool ProxyClientSocket::SanitizeProxyAuth(HttpResponseInfo* response) {
scoped_refptr<HttpResponseHeaders> new_headers = new HttpResponseHeaders(
HttpUtil::AssembleRawHeaders(kHeaders, arraysize(kHeaders)));
+ // Copy status line and all hop-by-hop headers to preserve keep-alive
+ // behavior.
new_headers->ReplaceStatusLine(old_headers->GetStatusLine());
- CopyHeaderValues(old_headers, new_headers, "Connection");
- CopyHeaderValues(old_headers, new_headers, "Proxy-Authenticate");
+ CopyHeaderValues(old_headers, new_headers, "connection");
+ CopyHeaderValues(old_headers, new_headers, "proxy-connection");
+ CopyHeaderValues(old_headers, new_headers, "keep-alive");
+ CopyHeaderValues(old_headers, new_headers, "trailer");
+ CopyHeaderValues(old_headers, new_headers, "transfer-encoding");
+ CopyHeaderValues(old_headers, new_headers, "upgrade");
+
+ CopyHeaderValues(old_headers, new_headers, "content-length");
cbentzel 2015/03/05 02:08:48 As we chatted, main thing I want to make sure is t
+
+ CopyHeaderValues(old_headers, new_headers, "proxy-authenticate");
response->headers = new_headers;
return true;
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698