Skip to main content

Bug Tracker

Side navigation

#8343 closed bug (wontfix)

Opened February 21, 2011 07:32PM UTC

Closed March 11, 2011 06:15PM UTC

AJAX with 206 Response Triggers Error Callback in Android Browser

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

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.

Attachments (0)
Change History (5)

Changed February 22, 2011 12:08AM UTC by jaubourg comment:1

component: unfiledajax
owner: → 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?

Changed February 22, 2011 05:06PM UTC by b@bdoms.com comment:2

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).

Changed February 22, 2011 05:26PM UTC by jaubourg comment:3

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.

Changed February 22, 2011 06:35PM UTC by b@bdoms.com comment:4

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.

Changed March 11, 2011 06:15PM UTC by jaubourg comment:5

resolution: → wontfix
status: assignedclosed

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