Closed Bug 570271 Opened 14 years ago Closed 14 years ago

Necko resets Accept header on redirect

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 401564

People

(Reporter: jleigh, Unassigned)

References

()

Details

(Keywords: helpwanted, student-project, Whiteboard: [parity-ie][parity-chrome][parity-opera] )

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3 If a server returns a redirect (like a 301 or 302) in a XMLHttpRequest GET request the browser will ignore any headers passed to setRequestHeader on subsequent requests. Reproducible: Always Steps to Reproduce: 1. new XMLHttpRequest() 2. setRequestHeader("Accept", "application/xml") 3. open("GET", "http://tinyurl.com/26lqch4") 4. getResponseHeader("Content-Type") is text/html Actual Results: The first request for http://tinyurl.com/26lqch4 includes the provided Accept header. GET /26lqch4 HTTP/1.1 Host: tinyurl.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3 Accept: application/xml, text/xml Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive HTTP/1.1 301 Moved Permanently X-Powered-By: PHP/5.3.2 Location: http://recessframework.org/demo/content-negotiation/tweet Content-Type: text/html Content-Length: 0 Connection: close Date: Sat, 05 Jun 2010 02:09:26 GMT Server: TinyURL/1.6 ---------------------------------------------------------- The second request for http://recessframework.org/demo/content-negotiation/tweet includes the default Accept header. GET /demo/content-negotiation/tweet HTTP/1.1 Host: recessframework.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-ca,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive HTTP/1.1 200 OK Date: Sat, 05 Jun 2010 02:09:19 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.2.9 X-Powered-By: PHP/5.2.9 Keep-Alive: timeout=15, max=511 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html ---------------------------------------------------------- Expected Results: The request for http://tinyurl.com/26lqch4 should behave the same as a direct request for http://recessframework.org/demo/content-negotiation/tweet - both should include the provided Accept header in the final request. The all request headers appear to be reset on subsequent requests. There is no client side workaround in mozilla. For reference, WebKit and IE repeats all provided headers in every request from XMLHttpRequest.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
I think we should fix this for the specific case of Accept in Necko. Accept should be transferred across a redirect, since it just indicates what we plan to do with the data and redirects don't affect that.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
Summary: XMLHttpRequest Resets Headers on Redirect → Necko resets Accept header on redirect
Duplicate of bug 401564? Very annoying:(
OS: Linux → All
Hardware: x86 → All
Whiteboard: [parity-ie][parity-chrome][parity-opera]
> Duplicate of bug 401564? Yes.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.