Closed
Bug 503095
Opened 16 years ago
Closed 8 years ago
XMLHttpRequest returns 0 (not 200) for local files, making local testing impractical.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: bryce2, Unassigned)
References
()
Details
Attachments
(2 files)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081213 SUSE/1.1.14-1.1 SeaMonkey/1.1.14
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081213 SUSE/1.1.14-1.1 SeaMonkey/1.1.14
Bug #424875 refers to a desire to use http:// urls from locally loaded scripts.
Bug #465397 refers to files one level up getting NS_ERROR_DOM_BAD_URI
This is different.
Place a script at file:///tmp/test.html. Load a URL of "test.xml". The file will load with a status of 0 rather that 200. This breaks most scripts. It can be coded around (by allowing "0" as a status code). But that's a hack.
True on Seamonkey and Firefox at least on Linux.
Reproducible: Always
Steps to Reproduce:
See attached sample script.
Actual Results:
The local filesystem should fake up a 200 or 404 error to better emulate what a server does.
| Reporter | ||
Comment 1•16 years ago
|
||
| Reporter | ||
Comment 2•16 years ago
|
||
| Reporter | ||
Comment 3•16 years ago
|
||
Keywords: xmlhttp.status , xmlhttp.statusText, Seamonkey, Firefox, XMLHttpRequest, locally stored files, local filesystem, file://
Component: General → XML
Product: Firefox → Core
QA Contact: general → xml
Comment 4•16 years ago
|
||
Note that the current XMLHttpRequest spec draft talks about raising an exception here. See http://www.w3.org/TR/XMLHttpRequest/#status
See also bug 304980.
Fundamentally, though, we're doing the same thing as IE last I checked, are we not? And since IE is basically what defines XMLHttpRequest behavior...
Comment 5•16 years ago
|
||
I should also note that making local filesystem testing look just like the web page is an explicit non-goal for many reasons (including the security ones you cited). If you want to test sites that use XHR locally, you really need to be running a local web server to get sane behavior in all sorts of ways, not just .status.
| Reporter | ||
Comment 6•16 years ago
|
||
Failing to load the file at all (rather than, sort of, loading it) might be a good goal.
Comment 7•8 years ago
|
||
Making file URLs better is not something we should invest time in.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Component: XML → DOM
Resolution: --- → WONTFIX
| Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•