This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26238 - [new feature] Add follow redirects back
Summary: [new feature] Add follow redirects back
Status: RESOLVED DUPLICATE of bug 28343
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: XHR (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-30 11:39 UTC by Jonathan Kingston
Modified: 2015-03-27 12:29 UTC (History)
3 users (show)

See Also:


Attachments

Description Jonathan Kingston 2014-06-30 11:39:18 UTC
Add follow redirects back into WHATWG XHR specification: http://xhr.spec.whatwg.org/

As mentioned on this post: http://discourse.specifiction.org/t/followredirects-in-xmlhttprequest/420/11?u=jonathank

The intent is to put back in the followRedirects feature which was a security improvement from the client side to prevent calls following to unexpected URL changes.

The expected result when the AJAX request returns a redirect code and followRedirects is disabled then it should return a network error.

This should follow the same definition as the original specification: http://www.w3.org/TR/2010/WD-XMLHttpRequest2-20100907/#the-followredirects-attribute

However it shouldn't return a response if there is a redirect just a network error to the callbacks.
Comment 1 Anne 2014-06-30 11:42:09 UTC
So the use case here is failing early, right?
Comment 2 Jonathan Kingston 2014-06-30 11:47:19 UTC
That is right, so to prevent scripts that really only want the one resource to be able to turn off the feature of jumping through the redirects.

The behaviour should be a browser engineered error code sent to the callbacks.

The browser should not follow any redirects at all, only one server call should be made.
Comment 3 Anne 2014-06-30 13:21:01 UTC
If we add this we should probably name it disableRedirectHandling per bug 25791. failOnRedirects or some such could maybe also work.
Comment 4 Anne 2014-10-20 16:19:42 UTC
I found out that with HSTS this could be used to detect whether a user has previously visited a site. It might be that CSP and other features enable the same kind of attack however.
Comment 5 Anne 2014-10-20 16:20:10 UTC
However, if we add this we might add it as a feature for fetch() instead.
Comment 6 Anne 2015-03-27 12:29:42 UTC
fetch() it is.

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