Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#4804 closed bug (invalid)

Safari XHR bug -- returns 404 when 401 on synchronous calls.

Reported by: sandro Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

Synchronous XHR call to a resource which returns a HTTP response code of 401. Safari 4.0 (and I believe earlier versions, though untested) will report xmlhttpobject.status == 404.

This does *not* happen on asynchronous calls.

Safari also seems to destroy *all* response headers (getAllResponseHeaders() is empty).

Notable: Chrome does not suffer from this bug. The hope is that it has been fixed in webkit.

Change History (4)

comment:1 Changed 10 years ago by dmethvin

Seems like a bug outside of jQuery scope; is this something that we could even detect?

comment:2 Changed 10 years ago by sandro

Agreed that it is not a JQuery bug per se. However, the fact remains that anyone using JQuery (or prototype, or any other library) will receive 401 but report 404 on synchronous calls to unauthorized resources. That is, if anyone uses JQuery xhr to access resources that require authentication (you see that this is not an edge case), using synchronous (blocking -- also not unexpected) calls, 404 will be rather bad status information for the callback to receive. Perhaps some sort of mention in the docs?

comment:3 Changed 9 years ago by dmethvin

Component: unfiledajax

comment:4 Changed 9 years ago by snover

Resolution: invalid
Status: newclosed

Thanks for the report, but this is not a jQuery bug. Furthermore, use of synchronous XMLHttpRequest calls is strongly discouraged.

Note: See TracTickets for help on using tickets.