diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-08 19:06:43 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-08 19:06:43 +0000 |
commit | f24ab372e7f2ace6a67e0d1d3fc02e793202d8e9 (patch) | |
tree | 2f1ec6590be11056b1a808369c836a707c984b13 /net/http | |
parent | 66b2bc1ccd6a7d41b71b602b2983aa81527f9c8f (diff) | |
download | chromium_src-f24ab372e7f2ace6a67e0d1d3fc02e793202d8e9.zip chromium_src-f24ab372e7f2ace6a67e0d1d3fc02e793202d8e9.tar.gz chromium_src-f24ab372e7f2ace6a67e0d1d3fc02e793202d8e9.tar.bz2 |
Revert 3024, broke mac build.
Review URL: http://codereview.chromium.org/6351
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_auth_handler_digest.cc | 2 | ||||
-rw-r--r-- | net/http/http_network_transaction.cc | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc index 18f166b..7f351b4 100644 --- a/net/http/http_auth_handler_digest.cc +++ b/net/http/http_auth_handler_digest.cc @@ -117,7 +117,7 @@ void HttpAuthHandlerDigest::GetRequestMethodAndPath( if (target_ == HttpAuth::AUTH_PROXY && url.SchemeIs("https")) { *method = "CONNECT"; - *path = url.host() + ":" + IntToString(url.EffectiveIntPort()); + *path = url.host() + ":" + GetImplicitPort(url); } else { *method = request->method; *path = HttpUtil::PathForRequest(url); diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 52e9328..de3539317 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -247,12 +247,13 @@ void HttpNetworkTransaction::BuildRequestHeaders() { // in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2 and // 5.3. void HttpNetworkTransaction::BuildTunnelRequest() { + std::string port = GetImplicitPort(request_->url); + // RFC 2616 Section 9 says the Host request-header field MUST accompany all // HTTP/1.1 requests. - request_headers_ = StringPrintf("CONNECT %s:%d HTTP/1.1\r\n", - request_->url.host(), request_->url.EffectiveIntPort()); - request_headers_ += "Host: " + request_->url.host(); - if (request_->url.has_port()) + request_headers_ = "CONNECT " + request_->url.host() + ":" + port + + " HTTP/1.1\r\nHost: " + request_->url.host(); + if (request_->url.IntPort() != -1) request_headers_ += ":" + request_->url.port(); request_headers_ += "\r\n"; @@ -452,11 +453,18 @@ int HttpNetworkTransaction::DoResolveHost() { t.GetNext(); host = t.token(); t.GetNext(); - port = StringToInt(t.token()); + port = static_cast<int>(StringToInt64(t.token())); } else { // Direct connection host = request_->url.host(); - port = request_->url.EffectiveIntPort(); + port = request_->url.IntPort(); + if (port == url_parse::PORT_UNSPECIFIED) { + if (using_ssl_) { + port = 443; // Default HTTPS port + } else { + port = 80; // Default HTTP port + } + } } return resolver_.Resolve(host, port, &addresses_, &io_callback_); |