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

Unified Diff: content/browser/download/download_resource_handler.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 | « no previous file | net/base/net_error_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_resource_handler.cc
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index 6be964c3e35859d3c1605560f4c395e2fa12bf96..e747dfbb9cde2f54c183156dd7fc43944dc15452 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -215,12 +215,12 @@ bool DownloadResourceHandler::OnResponseCompleted(
net::Error error_code = net::OK;
if (status.status() == net::URLRequestStatus::FAILED)
error_code = static_cast<net::Error>(status.error()); // Normal case.
- // ERR_CONNECTION_CLOSED is allowed since a number of servers in the wild
- // advertise a larger Content-Length than the amount of bytes in the message
- // body, and then close the connection. Other browsers - IE8, Firefox 4.0.1,
- // and Safari 5.0.4 - treat the download as complete in this case, so we
- // follow their lead.
- if (error_code == net::ERR_CONNECTION_CLOSED)
+ // ERR_CONTENT_LENGTH_MISMATCH is allowed since a number of servers in the
+ // wild advertise a larger Content-Length than the amount of bytes in the
+ // message body, and then close the connection. Other browsers - IE8,
+ // Firefox 4.0.1, and Safari 5.0.4 - treat the download as complete in this
+ // case, so we follow their lead.
+ if (error_code == net::ERR_CONTENT_LENGTH_MISMATCH)
error_code = net::OK;
InterruptReason reason =
ConvertNetErrorToInterruptReason(error_code,
« no previous file with comments | « no previous file | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698