Last Comment Bug 433859 - XMLHttpRequest should set Accept to */* when not part of author headers
: XMLHttpRequest should set Accept to */* when not part of author headers
Status: RESOLVED DUPLICATE of bug 918752
dom-triaged btpp-backlog
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
-- normal with 5 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Andrew Overholt [:overholt]
Depends on:
Blocks: xhr
  Show dependency treegraph
Reported: 2008-05-15 04:36 PDT by Laurens Holst
Modified: 2016-07-29 10:47 PDT (History)
10 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Laurens Holst 2008-05-15 04:36:55 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5

According to the XMLHttpRequest specification [1], “[the User Agent] must not
automatically set the Accept [header]”. Currently, Firefox 3b5 sends ‘Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8’. This is incorrect, and should be fixed to not send an Accept header at all.

The rationale behind the specification is that when an Accept header is not set
explicitly, we do not know what the application expects. Setting a default
Accept header effectively means that we are lying to the server, and breaking
correct functioning of HTTP content negotiation.

For further details and a test see my blog post [2].



Reproducible: Always

Steps to Reproduce:
1. Go to
2. Try the test by clicking on the button
Actual Results:  
Server receives Accept header with contents "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"

Expected Results:  
Server should not receive an Accept header at all.
Comment 1 User image Laurens Holst 2008-05-15 13:14:18 PDT
Note that this bug references the 15 April 2008 working draft of the spec.

Additionally, Firefox needs to line up with other browsers (or other browsers need to line up with Firefox :)) with regard to setRequestHeader('Accept', '') and setRequestHeader('Accept', null).

See also discussion on the W3C WebAPI WG list:

Comment 2 User image :Ms2ger (⌚ UTC+1/+2) 2011-10-10 12:34:29 PDT
If the user agent implements server-driven content-negotiation it must follow these constraints for the Accept and Accept-Language request headers:

 o Both headers must not be modified if they are already set through

 o If not set through setRequestHeader() Accept-Language should be set
   as appropriate.

 o If not set through setRequestHeader() Accept must be set with as
   value */*.

is all I can find about 'Accept' in <>.
Comment 3 User image David Bruant 2015-12-23 03:41:23 PST
I came across this bug via a random Google search. Setting a dependency. It may or may not already be fixed, but at least, it won't be an orphan any longer.
Comment 4 User image Mike 2016-01-20 14:16:28 PST
Seeing this in version 42.0
Comment 5 User image Peter Michaux 2016-02-23 11:50:54 PST
Wow! It is 2016 and this bug in Firefox 44 still exists. Please fix to conform to the XMLHttpRequest standard.
Comment 6 User image :Ms2ger (⌚ UTC+1/+2) 2016-02-23 23:53:21 PST
The requirement is now in
Comment 7 User image Mike 2016-07-29 10:14:29 PDT
Still in ver 47...
Comment 8 User image Thomas Wisniewski 2016-07-29 10:47:24 PDT

*** This bug has been marked as a duplicate of bug 918752 ***

Note You need to log in before you can comment on or make changes to this bug.