Closed
Bug 1062368
Opened 10 years ago
Closed 10 years ago
Ajax requests for blob URLs return 0 as .status even if the load succeeds
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 716491
People
(Reporter: nolan, Unassigned)
Details
Attachments
(1 file)
73.83 KB,
application/x-gzip
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Steps to reproduce:
I have a live example available here: http://bl.ocks.org/nolanlawson/3b18fbdda653f4e5f612
See the index.js in the example for the steps to reproduce.
When the image is fetched via ajax, it should return the correct content type and length (as it does in Chrome and IE), but in Firefox it throws a 405.
Actual results:
Firefox throws a 405.
Expected results:
Firefox returns the results normally.
Updated•10 years ago
|
Component: Untriaged → Networking
Product: Firefox → Core
Updated•10 years ago
|
Component: Networking → DOM: Core & HTML
![]() |
||
Comment 1•10 years ago
|
||
This is what pouchdb is doing:
if (xhr.status >= 200 && xhr.status < 300) {
...
} else {
onError(xhr, callback);
}
In this case, this is not an HTTP request, so the .status is 0 in Gecko. Then pouchdb randomly decides to claim "405" instead of "0":
if (err.withCredentials && err.status === 0) {
// apparently this is what we get when the method
// is reported as not allowed by CORS. so fudge it
errObj.status = 405;
errObj.statusText = "Method Not Allowed";
}
https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html doesn't seem to define what .status should be in non-HTTP cases.
http://xhr.spec.whatwg.org/ doesn't seem to define what .status should be at all, except by reference to fetch, which I can't make sense of. :(
Flags: needinfo?(annevk)
![]() |
||
Comment 2•10 years ago
|
||
But note bug 716491 and bug 918691. So per those it seems like we should just pretend 200/OK if the load succeeds.
What is .statusText expected to be when the load fails? I guess empty string?
Summary: Ajax requests for blob URLs throw a 405 error → Ajax requests for blob URLs return 0 as .status even if the load succeeds
![]() |
||
Comment 3•10 years ago
|
||
I'm going to dup this to bug 716491, I guess, and fix things there.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•