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

Unified Diff: webkit/glue/weburlloader_impl.cc

Issue 8496016: Report ERR_CONTENT_LENGTH_MISMATCH when the count of bytes received doesn't match Content-Length. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clear error Created 9 years, 1 month 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/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/weburlloader_impl.cc
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index 7b4ec9b79f564571687f4697015ead4f85ba40e7..871f5a39986db5f0479823de0cc2c34514fed329 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -592,7 +592,7 @@ void WebURLLoaderImpl::Context::OnReceivedCachedMetadata(
}
void WebURLLoaderImpl::Context::OnCompletedRequest(
- const net::URLRequestStatus& status,
+ const net::URLRequestStatus& original_status,
const std::string& security_info,
const base::Time& completion_time) {
if (ftp_listing_delegate_.get()) {
@@ -603,6 +603,16 @@ void WebURLLoaderImpl::Context::OnCompletedRequest(
multipart_delegate_.reset(NULL);
}
+ net::URLRequestStatus status = original_status;
+
+ // Rewrite the Content-Length mismatch as a success.
+ // See crbug.com/52847 for justification.
+ if (status.status() != net::URLRequestStatus::SUCCESS &&
+ status.error() == net::ERR_CONTENT_LENGTH_MISMATCH) {
+ status.set_status(net::URLRequestStatus::SUCCESS);
+ status.set_error(net::OK);
+ }
+
// Prevent any further IPC to the browser now that we're complete, but
// don't delete it to keep any downloaded temp files alive.
DCHECK(!completed_bridge_.get());
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698