summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 23:35:38 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 23:35:38 +0000
commit3971e254d01cc6c904b9fe724faca6810578b0c8 (patch)
tree6f18b78ad7970df7f458bedd903853685de40935 /net/http
parent8dfe9a09ec348ae0e552534f03d5fbae868a7915 (diff)
downloadchromium_src-3971e254d01cc6c904b9fe724faca6810578b0c8.zip
chromium_src-3971e254d01cc6c904b9fe724faca6810578b0c8.tar.gz
chromium_src-3971e254d01cc6c904b9fe724faca6810578b0c8.tar.bz2
Revert 11484 to try to heal plugin_test failure
tbr=abarth Review URL: http://codereview.chromium.org/42101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction.cc15
-rw-r--r--net/http/http_network_transaction_unittest.cc59
2 files changed, 1 insertions, 73 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 95c0aef..93b5a5d 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -207,17 +207,6 @@ int HttpNetworkTransaction::Read(IOBuffer* buf, int buf_len,
if (!connection_.is_initialized())
return 0; // connection_ has been reset. Treat like EOF.
- if (establishing_tunnel_) {
- // We're trying to read the body of the response but we're still trying to
- // establish an SSL tunnel through the proxy. We can't read these bytes
- // when establishing a tunnel because they might be controlled by an active
- // network attacker. We don't worry about this for HTTP 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
- return ERR_TUNNEL_CONNECTION_FAILED;
- }
-
read_buf_ = buf;
read_buf_len_ = buf_len;
@@ -1013,9 +1002,7 @@ int HttpNetworkTransaction::DidReadResponseHeaders() {
// domain name does not exist."
LOG(WARNING) <<
"Blocked proxy response to CONNECT request with status " <<
- headers->response_code() << " for " <<
- request_->url.host() << ":" <<
- request_->url.EffectiveIntPort() << ".";
+ headers->response_code() << ".";
return ERR_TUNNEL_CONNECTION_FAILED;
}
}
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 337f6c7..e73fc45 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -1159,65 +1159,6 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) {
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
}
-// Test that we don't read the response body when we fail to establish a tunnel,
-// even if the user cancels the proxy's auth attempt.
-TEST_F(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) {
- // Configure against proxy server "myproxy:70".
- scoped_ptr<net::ProxyService> proxy_service(
- CreateFixedProxyService("myproxy:70"));
-
- scoped_refptr<net::HttpNetworkSession> session(
- CreateSession(proxy_service.get()));
-
- scoped_ptr<net::HttpTransaction> trans(new net::HttpNetworkTransaction(
- session.get(), &mock_socket_factory));
-
- net::HttpRequestInfo request;
- request.method = "GET";
- request.url = GURL("https://www.google.com/");
- request.load_flags = 0;
-
- // Since we have proxy, should try to establish tunnel.
- MockWrite data_writes[] = {
- MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n"
- "Host: www.google.com\r\n\r\n"),
- };
-
- // The proxy responds to the connect with a 407.
- MockRead data_reads[] = {
- MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
- MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
- MockRead("Content-Length: 10\r\n\r\n"),
- MockRead(false, net::ERR_UNEXPECTED), // Should not be reached.
- };
-
- MockSocket data;
- data.writes = data_writes;
- data.reads = data_reads;
- mock_sockets[0] = &data;
- mock_sockets[1] = NULL;
-
- TestCompletionCallback callback;
-
- int rv = trans->Start(&request, &callback);
- EXPECT_EQ(net::ERR_IO_PENDING, rv);
-
- rv = callback.WaitForResult();
- EXPECT_EQ(net::OK, rv);
-
- const net::HttpResponseInfo* response = trans->GetResponseInfo();
- EXPECT_FALSE(response == NULL);
-
- EXPECT_TRUE(response->headers->IsKeepAlive());
- EXPECT_EQ(407, response->headers->response_code());
- EXPECT_EQ(10, response->headers->GetContentLength());
- EXPECT_TRUE(net::HttpVersion(1, 1) == response->headers->GetHttpVersion());
-
- std::string response_data;
- rv = ReadTransaction(trans.get(), &response_data);
- EXPECT_EQ(net::ERR_TUNNEL_CONNECTION_FAILED, rv);
-}
-
static void ConnectStatusHelperWithExpectedStatus(
const MockRead& status, int expected_status) {
// Configure against proxy server "myproxy:70".