XMLHttpRequest - property to disable following redirects

RESOLVED WONTFIX

Status

()

--
enhancement
RESOLVED WONTFIX
10 years ago
a year ago

People

(Reporter: rockmfr, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
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
(Reporter)

Updated

9 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 1

3 years ago
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.

Comment 2

3 years ago
Please file first a spec (https://xhr.spec.whatwg.org/) bug about adding this kind of feature.
https://github.com/whatwg/xhr/issues/new

Comment 3

a year ago
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
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.