Bug Tracker

Modify

Ticket #4804 (closed bug: invalid)

Opened 4 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by dmethvin

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

comment:2 Changed 4 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 3 years ago by dmethvin

  • Component changed from unfiled to ajax

comment:4 Changed 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to invalid

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.