| Index: net/url_request/url_request_http_job.cc
|
| diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
| index 2b8988b6c410dbfee89cf53334801bc68a1e27cf..66e3d31efe00f79229bbb9cce3189e4043aef06a 100644
|
| --- a/net/url_request/url_request_http_job.cc
|
| +++ b/net/url_request/url_request_http_job.cc
|
| @@ -754,9 +754,6 @@ void URLRequestHttpJob::OnHeadersReceivedCallback(int result) {
|
| void URLRequestHttpJob::OnReadCompleted(int result) {
|
| read_in_progress_ = false;
|
|
|
| - if (ShouldFixMismatchedContentLength(result))
|
| - result = 0;
|
| -
|
| if (result == 0) {
|
| NotifyDone(URLRequestStatus());
|
| } else if (result < 0) {
|
| @@ -1093,28 +1090,6 @@ void URLRequestHttpJob::ContinueDespiteLastError() {
|
| weak_factory_.GetWeakPtr(), rv));
|
| }
|
|
|
| -bool URLRequestHttpJob::ShouldFixMismatchedContentLength(int rv) const {
|
| - // Some servers send the body compressed, but specify the content length as
|
| - // the uncompressed size. Although this violates the HTTP spec we want to
|
| - // support it (as IE and FireFox do), but *only* for an exact match.
|
| - // See http://crbug.com/79694.
|
| - if (rv == net::ERR_CONNECTION_CLOSED) {
|
| - if (request_ && request_->response_headers()) {
|
| - int64 expected_length = request_->response_headers()->GetContentLength();
|
| - VLOG(1) << __FUNCTION__ << "() "
|
| - << "\"" << request_->url().spec() << "\""
|
| - << " content-length = " << expected_length
|
| - << " pre total = " << prefilter_bytes_read()
|
| - << " post total = " << postfilter_bytes_read();
|
| - if (postfilter_bytes_read() == expected_length) {
|
| - // Clear the error.
|
| - return true;
|
| - }
|
| - }
|
| - }
|
| - return false;
|
| -}
|
| -
|
| bool URLRequestHttpJob::ReadRawData(IOBuffer* buf, int buf_size,
|
| int* bytes_read) {
|
| DCHECK_NE(buf_size, 0);
|
| @@ -1125,9 +1100,6 @@ bool URLRequestHttpJob::ReadRawData(IOBuffer* buf, int buf_size,
|
| buf, buf_size,
|
| base::Bind(&URLRequestHttpJob::OnReadCompleted, base::Unretained(this)));
|
|
|
| - if (ShouldFixMismatchedContentLength(rv))
|
| - rv = 0;
|
| -
|
| if (rv >= 0) {
|
| *bytes_read = rv;
|
| if (!rv)
|
|
|