Closed
Bug 918752
Opened 11 years ago
Closed 8 years ago
[XHR2] Default Accept: header more complex than */*
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: hsteen, Assigned: wisniewskit)
References
()
Details
(Keywords: dev-doc-complete, site-compat)
Attachments
(1 file, 3 obsolete files)
If no author-supplied Accept header is given, the default should be */*
Test case:
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/send-accept.htm
Assignee | ||
Comment 1•9 years ago
|
||
Here is a simple patch that overrides accept accordingly in Send(), if it has not been user-specified.
Attachment #8760829 -
Flags: review?(jst)
Assignee | ||
Comment 2•9 years ago
|
||
Note that bug 433859 is a dupe of this one. It does mention the fetch API has the same requirement, but the fetch API's related test is passing already: http://w3c-test.org/fetch/api/basic/accept-header.html
It might be worth changing that test so it also verifies that Accept can be overridden, as it only checks that */* is set by default (the same change might be worth adding to this XHR test).
Also, the Fetch spec isn't as simple as just requiring */*, but requires specific UA strings for navigation requests and certain request content types (see https://fetch.spec.whatwg.org/#concept-fetch). It seems the test isn't checking those cases... perhaps it's outdated?
Reporter | ||
Comment 3•9 years ago
|
||
(That XHR test is already checking that Accept can be overridden, no? Master repo: https://github.com/w3c/web-platform-tests/blob/master/XMLHttpRequest/send-accept.htm )
Assignee | ||
Comment 4•9 years ago
|
||
Ah, indeed it is. Strange that I would have missed that; guess I didn't expect it to test for more than one thing at once.
Assignee | ||
Comment 5•8 years ago
|
||
Comment on attachment 8760829 [details] [diff] [review]
918752-set-accept-request-header-properly-if-not-user-set-for-xhrs.diff
Review of attachment 8760829 [details] [diff] [review]:
-----------------------------------------------------------------
Changing reviewers, just in case :jst is unavailable. Hopefully this isn't a faux pas...
Attachment #8760829 -
Flags: review?(jst) → review?(jonas)
Assignee | ||
Comment 6•8 years ago
|
||
Here's a successful try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ef87b0be88b2
The noted failures there are happening for me locally with or without this patch, so they should be unrelated.
Assignee | ||
Comment 7•8 years ago
|
||
Rebased.
Attachment #8760829 -
Attachment is obsolete: true
Attachment #8760829 -
Flags: review?(jonas)
Attachment #8766840 -
Flags: review?(jst)
Assignee | ||
Comment 8•8 years ago
|
||
Rebased.
Assignee: nobody → wisniewskit
Attachment #8766840 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8766840 -
Flags: review?(jst)
Attachment #8771717 -
Flags: review?(jst)
Updated•8 years ago
|
Attachment #8771717 -
Flags: review?(jst) → review+
Updated•8 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 10•8 years ago
|
||
Rebased the patch. Try seems fine: https://treeherder.mozilla.org/#/jobs?repo=try&revision=76c1042164ad
There were no functional changes, just a minor update to a test I had missed, so I'm carrying over r+ and requesting check-in.
Attachment #8771717 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 11•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/00afd3c93ccf
Override Accept request header to */* in XMLHttpRequest::Send() if it is not specified by the user. r=jst
Keywords: checkin-needed
Comment 12•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Comment 13•8 years ago
|
||
Posted the site compatibility doc: https://www.fxsitecompat.com/en-CA/docs/2016/accept-header-for-xhr-has-been-simplified/
Keywords: site-compat
Comment 14•8 years ago
|
||
Added mentions in the docs:
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader
and
https://developer.mozilla.org/en-US/Firefox/Releases/51#Others
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•