diff options
author | ellyjones@chromium.org <ellyjones@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-22 00:46:57 +0000 |
---|---|---|
committer | ellyjones@chromium.org <ellyjones@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-22 00:46:57 +0000 |
commit | 262191714589043d5b2dc3c7030b044787712047 (patch) | |
tree | 1a9e2103319557ab6cfd8f6f2507202bc8c70f69 /gin/modules/module_registry.cc | |
parent | 03cc8854790c813eeffe9bce4882b50720f2cdb6 (diff) | |
download | chromium_src-262191714589043d5b2dc3c7030b044787712047.zip chromium_src-262191714589043d5b2dc3c7030b044787712047.tar.gz chromium_src-262191714589043d5b2dc3c7030b044787712047.tar.bz2 |
Fix content-encoding handling with buggy servers.
Some servers will serve compressed filetypes with "content-encoding: gzip"
because the file's contents were gzipped, even though the server is not
re-encoding the contents at all. The code in Filter::FixupEncodingTypes()
attempts to work around this by inferring whether the file is a gzip file with
bogus encoding based on the file extension in the URL, but this doesn't work
when the file being downloaded comes from a page whose extension doesn't reveal
the downloaded file type.
This change adds code to FixupEncodingTypes to also consider the download
filename, supplied by the "content-disposition" header, if any. This means that
we now behave correctly in the case where:
-> GET /foo.php?download
<- HTTP/1.1 200 OK
<- ...
<- Content-Disposition: attachment;filename="foo.tar.gz"
<- ...
<- Content-Encoding: gzip
BUG=83292
TEST=unit,trybot
Review URL: https://codereview.chromium.org/206503006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258729 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/modules/module_registry.cc')
0 files changed, 0 insertions, 0 deletions