[whatwg] XMLHttpRequest.status on connection timeout
Maciej Stachowiak
mjs at apple.com
Fri Dec 9 13:49:03 PST 2005
On Nov 30, 2005, at 2:12 AM, Jim Ley wrote:
> On 11/30/05, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>> What should XMLHttpRequest.status return on connection timeout?
>> Ian and I were
>> talking about this, and it seems like "502" is a good response
>> code here...
>>
>> See https://bugzilla.mozilla.org/show_bug.cgi?id=304980
>
> I understood the aim was to mimic IE's implementation? Which will
> return a 5 digit code in the 12xxx range from WinInet for errors not
> returned by a server)
>
> Of the 5xx 504 is more justifiable than 502, as then you can pretend
> the browser is simply a proxy which has timed out, 502 which
> specifically mentions an invalid response doesn't sound a good idea.
>
> I believe Safari now has a 1 year timeout, so that could be an
> interesting test to run on a release build :-)
We try to have an effectively unlimited timeout for most things, but
currently have a 30 second timeout for synchronous XMLHttpRequest to
avoid blocking the UI forever. Due to the existence of very slow
severs, timeout is often more annoying than helpful. It might be good
to provide an API to set a timeout, on the other hand, it's not hard
for JS code to do its own timeout and cancel the request.
Regards,
Maciej
More information about the whatwg
mailing list