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

Unified Diff: net/http/http_network_transaction.cc

Issue 2835403003: Do not abort redirect responses with unadvertised encoding. (Closed)
Patch Set: Pulled the check out of the loop and report "false" for valid responses Created 3 years, 8 months 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/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index fbdf5cef4e83b5f3f80eac1bc7dcfab1ad34fd64..2db34f14e62640af44d66da2a056c1f5502deb5a 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -1801,6 +1801,7 @@ bool HttpNetworkTransaction::ContentEncodingsValid() const {
if (allowed_encodings.find("*") != allowed_encodings.end())
return true;
+ bool result = true;
for (auto const& encoding : used_encodings) {
SourceStream::SourceType source_type =
FilterSourceStream::ParseEncodingType(encoding);
@@ -1808,11 +1809,21 @@ bool HttpNetworkTransaction::ContentEncodingsValid() const {
if (source_type == SourceStream::TYPE_UNKNOWN)
continue;
if (allowed_encodings.find(encoding) == allowed_encodings.end()) {
- FilterSourceStream::ReportContentDecodingFailed(source_type);
- return false;
+ FilterSourceStream::ReportContentDecodingFailed(
+ SourceStream::TYPE_REJECTED);
+ result = false;
+ break;
}
}
- return true;
+
+ // Temporary workaround for http://crbug.com/714514
+ if (headers->IsRedirect(nullptr)) {
+ UMA_HISTOGRAM_BOOLEAN("Net.RedirectWithUnadvertisedContentEncoding",
+ !result);
+ return true;
+ }
+
+ return result;
}
} // namespace net
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698