Is ClearBogusContentEncodingIfNeeded() needed?
Categories
(Core :: Networking, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: annevk, Assigned: emilio)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
![]() |
||
Comment 1•11 years ago
|
||
![]() |
||
Comment 2•11 years ago
|
||
Reporter | ||
Comment 3•11 years ago
•
|
||
![]() |
||
Comment 4•11 years ago
|
||
Comment 5•9 years ago
|
||
Updated•9 years ago
|
Comment 6•8 years ago
|
||
![]() |
||
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
![]() |
||
Comment 9•8 years ago
|
||
Comment 10•8 years ago
|
||
![]() |
||
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
![]() |
||
Comment 13•8 years ago
|
||
Comment 14•7 years ago
|
||
Reporter | ||
Comment 15•6 years ago
|
||
Comment 16•5 years ago
|
||
(In reply to Anne (:annevk) from comment #15)
I created https://github.com/whatwg/fetch/pull/816 to remove the quirk from
Fetch, sorry for the delay.
I guess this means the consensus is to remove ClearBogusContentEncodingIfNeeded()
in our code.
Anne, do you know if there is any concern about removing this?
Reporter | ||
Comment 17•5 years ago
|
||
I would recommend unshipping this in EARLY_BETA_OR_EARLIER and then unshipping it completely in a follow-up release (or perhaps two releases later now that releases are more frequent). Please also communicate this in an Intent to unship. I would not expect much fallout as other browsers do not have this, but better to be on the safe side here.
![]() |
||
Comment 18•5 years ago
|
||
So just to be clear, the proposal here is:
- Not to change the higher-level "what filename do we pick when saving, and do we decompress when saving?" behavior.
- Remove the encoding-stripping in the necko code.
Is that correct?
Reporter | ||
Comment 19•5 years ago
|
||
Yes, this is only about 2, though I do think doing something different from other browsers is risky for 1, even if we're arguably more correct, as folks often stop trying the moment the thing they are deploying works in whatever browser they test in (which is likely a majority market share browser).
![]() |
||
Comment 20•5 years ago
|
||
Sure, but are there cases where our behavior for 1 would make things worse than the other browsers in practice?
![]() |
||
Updated•5 years ago
|
Comment 22•5 years ago
•
|
||
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #18)
So just to be clear, the proposal here is:
- Not to change the higher-level "what filename do we pick when saving, and do we decompress when saving?" behavior.
- Remove the encoding-stripping in the necko code.
Is that correct?
As said in comment 9, only doing 2 doesn't change firefox's behavior. Removing ClearBogusContentEncodingIfNeeded()
only helps bug 1597602, but it's apparently that the issue in bug 1597602 is at server side.
After some thinking, I'm inclined to not change firefox's behavior.
Updated•5 years ago
|
Comment 23•5 years ago
|
||
I've came across a case when this heuristic does things wrong.
My Mattermost installation compresses everything it sends out, even .tar.gz attachments. The response headers look like this:
< content-type: application/gzip
< content-disposition: attachment;filename="shifty.tar.gz"; filename*=UTF-8''shifty.tar.gz
< content-encoding: gzip
This heuristic strips the content-encoding, and Firefox saves an archive compressed with gzip twice.
Comment 25•5 years ago
|
||
Content-Type shouldn't affect Content-Encoding. All other browsers decode from transport first using Content-Encoding, then decide if how to download it (Open it with application X or just unzip or just store) according to Content-Type. Content-Encoding should never be ignored.
I've seen 3 bug reports about the side-effects of this 12-year old workaround reported in the last ~1 year. Isn't it better to mimic other browsers' behavior about the current behavior at this point?
In the worst case, when someone downloads a (Such old Apache servers already have multiple critical vulnerabilities, they should better be updated if they're not hacked already)..tar.gz
file from their archaic server they'll just download it as .tar
and not notice an issue
Currently, e.g. for Bug 1560525 we need to remove it as a workaround for modern misconfigured servers, which are far more important (remember webcompat?). The standard workaround is not to have a workaround. Let's rely on the default behavior!
Websites most likely won't fix themselves for only Firefox anyway... An alternative approach is to print a console warning when the workaround is triggered? Or even better, a warning when the workaround is triggered but Content-Encoding is not dropped? The latter both helps fixing the web and keeps things working. Currently, we do neither.
Assignee | ||
Comment 26•3 years ago
|
||
Other browsers don't do this and it causes compat issues.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 27•3 years ago
|
||
Comment 28•3 years ago
|
||
bugherder |
Description
•