Closed
Bug 366091
Opened 19 years ago
Closed 8 years ago
XMLHttpRequest throws FILE_NOT_FOUND when bad URL passed
Categories
(Core :: XML, defect)
Core
XML
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: BenB, Unassigned)
Details
Reproduction:
- Pass an nsIURL XPCOM object to open() [1] instead of a string, so that the URL arg probably ends up being "[xpconnect wrapped (nsISupports, nsIURI, nsIURL)]"
Actual result:
You see an error on the error console
Error: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXMLHttpRequest.send]
Source File: chrome://your/test/code.js
Line: nnn
Expected result:
Error NS_ERROR_INVALID_ARG [2] or something more specific.
[1] http://lxr.mozilla.org/seamonkey/source/content/base/public/nsIXMLHttpRequest.idl#216
[2] http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsError.h#191
| Reporter | ||
Comment 1•19 years ago
|
||
Oh, and I expect open() to throw, not send(). That's another reason why I was searching myself crazy.
Updated•16 years ago
|
Assignee: xml → nobody
QA Contact: ashshbhatt → xml
Comment 2•9 years ago
|
||
Indeed the nsIURI is stringified into something like "[xpconnect wrapped (nsISupports, nsIURI, nsIURL) @ 0x7f2f2d912c40 (native @ 0x7f2f3e436108)]", which is then fed into NS_NewURI and passes muster as a valid URI (thus the open() method doesn't throw). The XHR then fails in the send() method as per spec (triggering onerror in the async case, or throwing a NetworkError in the sync case).
I'm not sure what the best course of action would be here. Support for Open(nsIURI) could be added, or this could just be WONTFIXed, given the seemingly low interest.
Comment 3•8 years ago
|
||
WONTFIX seems fine.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•