summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/http/http_chunked_decoder.cc3
-rw-r--r--net/http/http_network_transaction.cc9
-rw-r--r--net/http/http_network_transaction_unittest.cc9
3 files changed, 13 insertions, 8 deletions
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc
index 1ecb9f4..14d1631 100644
--- a/net/http/http_chunked_decoder.cc
+++ b/net/http/http_chunked_decoder.cc
@@ -154,7 +154,8 @@ int HttpChunkedDecoder::ScanForChunkRemaining(const char* buf, int buf_len) {
// While the HTTP 1.1 specification defines chunk-size as 1*HEX
// some sites rely on more lenient parsing.
-// http://www.yahoo.com/ for example, includes trailing spaces (0x20).
+// http://www.yahoo.com/, for example, pads chunk-size with trailing spaces
+// (0x20) to be 7 characters long, such as "819b ".
//
// A comparison of browsers running on WindowsXP shows that
// they will parse the following inputs (egrep syntax):
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 9783025..6076fab 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -472,7 +472,7 @@ int HttpNetworkTransaction::DoResolveHost() {
int HttpNetworkTransaction::DoResolveHostComplete(int result) {
bool ok = (result == OK);
- DidFinishDnsResolutionWithStatus(ok, this->request_->referrer, this);
+ DidFinishDnsResolutionWithStatus(ok, request_->referrer, this);
if (ok) {
next_state_ = STATE_CONNECT;
} else {
@@ -1149,8 +1149,11 @@ bool HttpNetworkTransaction::SelectNextAuthIdentityToTry(
auth_identity_[target].source == HttpAuth::IDENT_SRC_NONE) {
auth_identity_[target].source = HttpAuth::IDENT_SRC_URL;
auth_identity_[target].invalid = false;
- auth_identity_[target].username = UTF8ToWide(request_->url.username());
- auth_identity_[target].password = UTF8ToWide(request_->url.password());
+ // TODO(wtc) It may be necessary to unescape the username and password
+ // after extracting them from the URL. We should be careful about
+ // embedded nulls in that case.
+ auth_identity_[target].username = ASCIIToWide(request_->url.username());
+ auth_identity_[target].password = ASCIIToWide(request_->url.password());
// TODO(eroman): If the password is blank, should we also try combining
// with a password from the cache?
return true;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 507b90b..fde12f4 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <math.h> // ceil
+#include <math.h> // ceil
+
#include "base/compiler_specific.h"
#include "base/platform_test.h"
#include "net/base/client_socket_factory.h"
@@ -899,14 +900,14 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) {
"Host: www.google.com\r\n\r\n"),
};
- // The proxy responds to the connect with a 404, using a persistent
+ // The proxy responds to the connect with a 404, using a persistent
// connection. Usually a proxy would return 501 (not implemented),
// or 200 (tunnel established).
MockRead data_reads1[] = {
MockRead("HTTP/1.1 404 Not Found\r\n"),
MockRead("Content-Length: 10\r\n\r\n"),
MockRead("0123456789"),
- MockRead(false, net::ERR_UNEXPECTED), // Should not be reached.
+ MockRead(false, net::ERR_UNEXPECTED), // Should not be reached.
};
MockSocket data1;
@@ -930,7 +931,7 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) {
EXPECT_EQ(404, 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_STREQ("0123456789", response_data.c_str());