Closed Bug 414543 Opened 17 years ago Closed 16 years ago

XHMLHttpRequest ignores custom headers on 303 redirect

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 401564

People

(Reporter: firefox.bugzilla, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008012804 Minefield/3.0b3pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008012804 Minefield/3.0b3pre When a response to a POST-request made with XMLHttpRequest is the HTTP-code 303 Firefox moves on and fetches the URL specified in the location header in the response with a GET. If the XMLHttpRequest had a custom header like "Accept: application/json" it is sent in the initial POST-request but not in the following GET-request making it impossible to tell the server what kind of responses the requesting code is capable of handling. To summarize: The initial POST-request made by XMLHttpRequest contains the correct Accept-header specified by setRequestHeader('Accept', 'application/json') - although if the response is a HTTP-code 303 it doesn't send the right header when it fetches that redirect. Reproducible: Always Steps to Reproduce: 1.Initiate an XMLHttpRequest object and call setRequestHeader('Accept', 'application/json') on it. 2.Make a request 3.Have the server respond with a http-code 303 and a new location 4.XMLHttpRequest will automatically handle the redirect - but will ignore the accept-header specified Actual Results: I ended up with a request for a response suitable for Firefox accept-headers. Expected Results: I should have ended up with a request for a JSON-response which is the suitable response for my AJAX-client needs according to it's specified accept-header.
This sounds like the same problem as in bug 401564, even though one is a POST -> GET redirect while the other is a GET -> GET redirect.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.