Skip to main content

Bug Tracker

Side navigation

#4804 closed bug (invalid)

Opened June 22, 2009 09:49PM UTC

Closed October 31, 2010 06:23PM UTC

Last modified March 13, 2012 07:24PM UTC

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.

Attachments (0)
Change History (4)

Changed June 23, 2009 01:20AM UTC by dmethvin comment:1

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

Changed June 23, 2009 06:59PM UTC by sandro comment:2

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?

Changed June 13, 2010 03:03AM UTC by dmethvin comment:3

component: unfiledajax

Changed October 31, 2010 06:23PM UTC by snover comment:4

resolution: → invalid
status: newclosed

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