Bug Tracker

Modify

Ticket #8343 (closed bug: wontfix)

Opened 2 years ago

Last modified 2 years ago

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

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.

Change History

comment:1 Changed 2 years ago by jaubourg

  • Owner set to jaubourg
  • Priority changed from undecided to low
  • Status changed from new to assigned
  • Component changed from unfiled to ajax

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 2 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 2 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 2 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 2 years ago by jaubourg

  • Status changed from assigned to closed
  • Resolution set to wontfix

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

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.