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

Unified Diff: net/filter/filter.cc

Issue 206503006: Fix content-encoding handling with buggy servers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Use GenerateFileName instead Created 6 years, 9 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 | « net/filter/filter.h ('k') | net/filter/filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/filter.cc
diff --git a/net/filter/filter.cc b/net/filter/filter.cc
index 244abaea10eead6e52ac95e5b52af3862c6f64ff..90d91e161b17f24f5eb9264a212323f02ec5d33f 100644
--- a/net/filter/filter.cc
+++ b/net/filter/filter.cc
@@ -8,6 +8,7 @@
#include "base/strings/string_util.h"
#include "net/base/io_buffer.h"
#include "net/base/mime_util.h"
+#include "net/base/net_util.h"
#include "net/filter/gzip_filter.h"
#include "net/filter/sdch_filter.h"
@@ -170,11 +171,14 @@ void Filter::FixupEncodingTypes(
encoding_types->clear();
GURL url;
+ std::string disposition;
success = filter_context.GetURL(&url);
DCHECK(success);
- base::FilePath filename =
- base::FilePath().AppendASCII(url.ExtractFileName());
- base::FilePath::StringType extension = filename.Extension();
+ filter_context.GetContentDisposition(&disposition);
+ // Don't supply a MIME type here, since that may cause disk IO.
+ base::FilePath filepath = GenerateFileName(url, disposition, "UTF-8", "",
+ "", "");
+ base::FilePath::StringType extension = filepath.Extension();
if (filter_context.IsDownload()) {
// We don't want to decompress gzipped files when the user explicitly
« no previous file with comments | « net/filter/filter.h ('k') | net/filter/filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698