Bug Tracker

Opened 10 years ago

Closed 10 years ago

#8343 closed bug (wontfix)

AJAX with 206 Response Triggers Error Callback in Android Browser

Reported by: b@… Owned by: jaubourg
Priority: low Milestone: 1.next
Component: ajax Version: 1.5
Keywords: Cc:
Blocked by: Blocking:


If you make an AJAX request like so:

$.ajax({headers: {"Range": "bytes=0-1000"}, success: successFunction, error: errorFunction});

Then servers will respond with the 206 Partial Content status code. In all the other browsers I tested, this correctly triggered successFunction upon return. However, in the Android Browser (I only tested with 2.2+), it triggers errorFunction instead. This also still happens in previous versions of jQuery (1.4) and if the range header is set with the beforeSend function instead.

Change History (5)

comment:1 Changed 10 years ago by jaubourg

Component: unfiledajax
Owner: set to jaubourg
Priority: undecidedlow
Status: newassigned

The only idea I can have right now is that the Android Browser native xhr does not convey the 206. What is the status code of the response as given client-side (what is shown if you alert jqXHR.status in the error callback)?

Also, could you test this with 1.5.1RC?

comment:2 Changed 10 years ago by b@…

I don't have a device with 1.5.1RC exactly, but I was able to use the Android emulator to test on what they say are 1.5, 1.6, and 2.1. None of those were affected. 2.2 on the emulator behaved the same as I described in the initial report.

jqXHR.status is "0" in the error callback (in Android 2.2).

comment:3 Changed 10 years ago by jaubourg

When I was talking about version 1.5.1RC, I was actually talking about the jQuery version ;)

If status 0 is received, than it's quite obviously a bug with Android browser (not propagating the correct status code) and I doubt there's anything we can do around it in jQuery.

comment:4 Changed 10 years ago by b@…

Ah. I see. Well, I tried it out with jQuery 1.5.1RC and there was no difference.

I've since reported this on the Android issue tracker (http://code.google.com/p/android/issues/detail?id=14924), because as you said, it's probably on their end.

comment:5 Changed 10 years ago by jaubourg

Resolution: wontfix
Status: assignedclosed

OK, I'll close this as wontfix for now as it's clearly an Android bug.

Note: See TracTickets for help on using tickets.