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

Unified Diff: net/http/http_network_transaction.cc

Issue 3091001: Revert 54528 - Digest authentication uses a uri field to prevent replay attac... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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_auth_handler_mock.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 54613)
+++ net/http/http_network_transaction.cc (working copy)
@@ -194,17 +194,6 @@
alternate_protocols->SetAlternateProtocolFor(host_port, port, protocol);
}
-GURL UpgradeUrlToHttps(const GURL& original_url) {
- GURL::Replacements replacements;
- // new_sheme and new_port need to be in scope here because GURL::Replacements
- // references the memory contained by them directly.
- const std::string new_scheme = "https";
- const std::string new_port = IntToString(443);
- replacements.SetSchemeStr(new_scheme);
- replacements.SetPortStr(new_port);
- return original_url.ReplaceComponents(replacements);
-}
-
} // namespace
//-----------------------------------------------------------------------------
@@ -693,7 +682,15 @@
endpoint_.set_port(alternate.port);
alternate_protocol_ = alternate.protocol;
alternate_protocol_mode_ = kUsingAlternateProtocol;
- alternate_endpoint_url = UpgradeUrlToHttps(*curr_endpoint_url);
+
+ url_canon::Replacements<char> replacements;
+ replacements.SetScheme("https",
+ url_parse::Component(0, strlen("https")));
+ const std::string port_str = base::IntToString(endpoint_.port());
+ replacements.SetPort(port_str.c_str(),
+ url_parse::Component(0, port_str.size()));
+ alternate_endpoint_url =
+ curr_endpoint_url->ReplaceComponents(replacements);
curr_endpoint_url = &alternate_endpoint_url;
}
}
@@ -783,25 +780,9 @@
request_->referrer, disable_resolver_cache);
if (proxy_info_.is_http()) {
- GURL authentication_url = request_->url;
- if (using_ssl_) {
- if (!authentication_url.SchemeIs("https")) {
- // If a proxy tunnel connection needs to be established due to
- // an Alternate-Protocol, the URL needs to be changed to indicate
- // https or digest authentication attempts will fail.
- // For example, suppose the initial request was for
- // "http://www.example.com/index.html". If this is an SSL
- // upgrade due to alternate protocol, the digest authorization
- // should have a uri="www.example.com:443" field rather than a
- // "/index.html" entry, even though the original request URL has not
- // changed.
- authentication_url = UpgradeUrlToHttps(authentication_url);
- }
- }
establishing_tunnel_ = using_ssl_;
http_proxy_params = new HttpProxySocketParams(proxy_tcp_params,
- authentication_url,
- endpoint_,
+ request_->url, endpoint_,
session_, using_ssl_);
} else {
DCHECK(proxy_info_.is_socks());
« no previous file with comments | « net/http/http_auth_handler_mock.cc ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698