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

Unified Diff: net/http/http_network_transaction.cc

Issue 3112034: Attempting to re-land CL 3110006 which turned out to have ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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_session.cc ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
===================================================================
--- net/http/http_network_transaction.cc (revision 57349)
+++ net/http/http_network_transaction.cc (working copy)
@@ -322,7 +322,7 @@
// because an active network attacker can already control HTTP sessions.
// We reach this case when the user cancels a 407 proxy auth prompt.
// See http://crbug.com/8473.
- DCHECK(proxy_info_.is_http());
+ DCHECK(proxy_info_.is_http() || proxy_info_.is_https());
DCHECK_EQ(headers->response_code(), 407);
LOG(WARNING) << "Blocked proxy response with status "
<< headers->response_code() << " to CONNECT request for "
@@ -683,7 +683,8 @@
HttpRequestHeaders request_headers;
BuildRequestHeaders(request_, authorization_headers, request_body,
- !is_https_request() && proxy_info_.is_http(),
+ !is_https_request() && (proxy_info_.is_http() ||
+ proxy_info_.is_https()),
&request_line, &request_headers);
if (session_->network_delegate())
@@ -1118,7 +1119,8 @@
}
bool HttpNetworkTransaction::ShouldApplyProxyAuth() const {
- return !is_https_request() && proxy_info_.is_http();
+ return !is_https_request() &&
+ (proxy_info_.is_https() || proxy_info_.is_http());
}
bool HttpNetworkTransaction::ShouldApplyServerAuth() const {
@@ -1159,13 +1161,15 @@
GURL HttpNetworkTransaction::AuthURL(HttpAuth::Target target) const {
switch (target) {
- case HttpAuth::AUTH_PROXY:
+ case HttpAuth::AUTH_PROXY: {
if (!proxy_info_.proxy_server().is_valid() ||
proxy_info_.proxy_server().is_direct()) {
return GURL(); // There is no proxy server.
}
- return GURL("http://" +
+ const char* scheme = proxy_info_.is_https() ? "https://" : "http://";
+ return GURL(scheme +
proxy_info_.proxy_server().host_port_pair().ToString());
+ }
case HttpAuth::AUTH_SERVER:
return request_->url;
default:
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698