Closed Bug 1983387 Opened 6 months ago Closed 2 months ago

Fetch requests with the `range` header don't set `Accept-Encoding: identity`

Categories

(Core :: DOM: Networking, defect, P3)

Firefox 141
defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: valadaptive, Assigned: valadaptive)

References

Details

(Keywords: webcompat:platform-bug, Whiteboard: [necko-triaged])

Attachments

(3 files)

Attached file fetchbug.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0

Steps to reproduce:

Make an HTTP request that uses the range header (see the attached file for a demo).

Actual results:

In servers that gzip the response, Firefox will not behave properly because it does not set Accept-Encoding: identity. In the attached demo, compare the results in Chrome and Firefox (you'll need to use the network tab in the inspector since Content-Encoding on the response side is not CORS-safelisted, or at least I think that's why it's not showing up).

In Chrome, the demo functions properly--the request headers contain Accept-Encoding: identity and the response headers omit Content-Encoding. In Firefox, the demo is broken--no results are shown, the request headers contain Accept-Encoding: gzip, deflate, br, zstd, identity, and the response headers contain content-encoding: gzip.

Expected results:

Fetch requests with the range header set should also set accept-encoding: identity, per https://github.com/whatwg/fetch/pull/751. This was apparently implemented in https://bugzilla.mozilla.org/show_bug.cgi?id=1782835, but seems to have regressed?

I'm running Firefox 141.0 as packaged for Fedora 42. Not sure if this is platform-specific.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Networking
Product: Firefox → Core

The merge flag in HttpBaseChannel::SetRequestHeader corresponds to the
"combine a header" behavior in the fetch spec, in which we add a value
to a comma-separated list of values in the header. The fetch spec does
not tell us to combine (Accept-Encoding, identity), it tells us to
append it. We got away with this before because of a sneaky WPT change
that I'm fixing upstream
(https://github.com/web-platform-tests/wpt/pull/54373).

Assignee: nobody → valadaptive
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: -- → S3
Priority: -- → P3
Whiteboard: [necko-triaged]
Duplicate of this bug: 1983947

We should land this. I think the WPT need updating.

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(valentin.gosu)
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
QA Whiteboard: [qa-triage-done-c149/b148]
Blocks: 2000524
Duplicate of this bug: 1874840
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: