Re: [XHR] Redirects

On Fri, Aug 27, 2010 at 5:50 AM, Anne van Kesteren <annevk@opera.com> wrote:

> On Fri, 13 Aug 2010 00:13:16 +0200, Joćo Eiras <joao.eiras@gmail.com>
> wrote:
>
>> Between the boolean and an integer, the integer is more useful, although
>> seeing long redirection chains is somewhat rare and overkill.
>>
>
> I went for a boolean followRedirects attribute as that gives sufficient
> low-level control that people can implement whatever behavior they want on
> top of that. (Including every use case mentioned in this thread.) This is an
> XMLHttpRequest Level 2 feature now:
>
> http://dev.w3.org/2006/webapi/XMLHttpRequest-2/
>
>
>
So the idea is that you would have to manually create the redirect request
using a new XHR if you wanted to manually follow the redirect?

One risk with that is that it is easy to construct the redirect request
improperly.  There's the classic example of what happens when you issue a
POST request and it results in a redirect.  303 and 307 had to be invented
because some browsers implemented 302 incorrectly.

Maybe there should be a way to create a new XHR from the existing XHR that
is already configured to follow the redirect?  I'm not sure how to make this
less awkward...

-Darin



>
> --
> Anne van Kesteren
> http://annevankesteren.nl/
>
>

Received on Tuesday, 31 August 2010 17:04:44 UTC