Closed Bug 454644 Opened 16 years ago Closed 7 years ago

XMLHttpRequest - property to disable following redirects

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: rockmfr, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16

XMLHttpRequest should have some way to disable the following of redirects (i.e., status codes 301, 302, etc). As far as I know, there are no browsers that currently have this functionality.

The W3C working draft (http://www.w3.org/TR/2008/WD-XMLHttpRequest-20080415/) has this to say about the matter:
"If the response is an HTTP redirect: If the redirect does not violate security or infinite loop precautions and the scheme is supported transparently follow the redirect..."
"This specification does not include the following features which are being considered for a future version of this specification: ... Property to disable following redirects; ..."

Related bugs: bug 238144, bug 343028, bug 385035

Reproducible: Always
Component: Networking: HTTP → DOM: Core & HTML
OS: Windows XP → All
QA Contact: networking.http → general
Hardware: PC → All
Status: UNCONFIRMED → NEW
Ever confirmed: true
I'd like to try to analyze and see if I can fix this bug. Anyone here can give me some information on where in the code is this working?
The useful information is mostly:
- Where the C++ files are for the XMLHttpRequest object.
- Where is the code that deals with the 301,302, etc... redirects.

Based on those, I should be able to find the path between the two and send a patch for this patch for evaluation.

I already know where the Mercurial repo is and I know where the online tools to search the code are.
Please file first a spec (https://xhr.spec.whatwg.org/) bug about adding this kind of feature.
https://github.com/whatwg/xhr/issues/new
We can't add this due to https://fetch.spec.whatwg.org/#atomic-http-redirect-handling (unless we event some new kind of CORS protocol for redirects, but nobody seems super interested in that).
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.