DescriptionFix 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
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=258729
Patch Set 1 #
Total comments: 1
Patch Set 2 : use Append() instead of AppendASCII() #Patch Set 3 : Use GetSuggestedFilename #
Total comments: 1
Patch Set 4 : Use GenerateFileName instead #
Messages
Total messages: 18 (0 generated)
|