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

Issue 206503006: Fix content-encoding handling with buggy servers. (Closed)

Created:
6 years, 9 months ago by Elly Fong-Jones
Modified:
6 years, 9 months ago
Reviewers:
asanka
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkgr
Visibility:
Public.

Description

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 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -3 lines) Patch
M net/filter/filter.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M net/filter/filter.cc View 1 2 3 2 chunks +7 lines, -3 lines 0 comments Download
M net/filter/filter_unittest.cc View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
M net/filter/mock_filter_context.h View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M net/filter/mock_filter_context.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 2 3 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
Elly Fong-Jones
PTAL? :)
6 years, 9 months ago (2014-03-20 20:10:40 UTC) #1
asanka
LGTM modulo character encoding fun. https://codereview.chromium.org/206503006/diff/1/net/filter/filter.cc File net/filter/filter.cc (right): https://codereview.chromium.org/206503006/diff/1/net/filter/filter.cc#newcode178 net/filter/filter.cc:178: filename = base::FilePath().AppendASCII(server_filename); Nit: ...
6 years, 9 months ago (2014-03-20 23:07:16 UTC) #2
Elly Fong-Jones
The CQ bit was checked by ellyjones@chromium.org
6 years, 9 months ago (2014-03-21 14:53:56 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ellyjones@chromium.org/206503006/20001
6 years, 9 months ago (2014-03-21 14:54:05 UTC) #4
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-21 15:17:18 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_compile_dbg
6 years, 9 months ago (2014-03-21 15:17:18 UTC) #6
asanka
Hold! It occurred to me that the correct way to do this would be to ...
6 years, 9 months ago (2014-03-21 15:57:07 UTC) #7
Elly Fong-Jones
On 2014/03/21 15:57:07, asanka wrote: > Hold! > > It occurred to me that the ...
6 years, 9 months ago (2014-03-21 17:41:55 UTC) #8
asanka
On 2014/03/21 17:41:55, Elly Jones wrote: > On 2014/03/21 15:57:07, asanka wrote: > > Hold! ...
6 years, 9 months ago (2014-03-21 17:57:26 UTC) #9
Elly Fong-Jones
On 2014/03/21 17:57:26, asanka wrote: > On 2014/03/21 17:41:55, Elly Jones wrote: > > On ...
6 years, 9 months ago (2014-03-21 18:08:26 UTC) #10
asanka
https://codereview.chromium.org/206503006/diff/40001/net/filter/filter.cc File net/filter/filter.cc (right): https://codereview.chromium.org/206503006/diff/40001/net/filter/filter.cc#newcode180 net/filter/filter.cc:180: net::GetSuggestedFilename(url, disposition, "UTF-8", "", "", ""); Nit: already in ...
6 years, 9 months ago (2014-03-21 18:23:14 UTC) #11
Elly Fong-Jones
The CQ bit was checked by ellyjones@chromium.org
6 years, 9 months ago (2014-03-21 19:02:33 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ellyjones@chromium.org/206503006/60001
6 years, 9 months ago (2014-03-21 19:03:44 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-21 19:06:57 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_clang_dbg
6 years, 9 months ago (2014-03-21 19:06:57 UTC) #15
Elly Fong-Jones
The CQ bit was checked by ellyjones@chromium.org
6 years, 9 months ago (2014-03-21 19:13:21 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ellyjones@chromium.org/206503006/60001
6 years, 9 months ago (2014-03-21 19:14:21 UTC) #17
commit-bot: I haz the power
6 years, 9 months ago (2014-03-22 00:47:03 UTC) #18
Message was sent while issue was closed.
Change committed as 258729

Powered by Google App Engine
This is Rietveld 408576698