Closed
Bug 313854
Opened 19 years ago
Closed 8 years ago
[XMLHttpRequest] responseXML contains error document for invalid XML files
Categories
(Core :: XML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 289714
People
(Reporter: pop2.bugzilla, Unassigned)
References
()
Details
(Keywords: regression)
Attachments
(1 file)
12.72 KB,
image/png
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050910 SeaMonkey/1.0a
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050910 SeaMonkey/1.0a
XMLHttpRequest fails to load an invalid XML file >6kb.
This happens when the server sends contentType=text/xml and the file is not valid XML.
All version before Gecko 1.8 work fine here and return responseXML=null and responseText with the contents.
One could argue that this is not a bug but a feature because the server sends the wrong header. But the problem is that sometimes we have no control about foreign servers.
Reproducible: Always
Steps to Reproduce:
Comment 1•19 years ago
|
||
If it's just failing without hanging the browser or crashing etc .. we should not be worried. Does it affect something else for you or this is not big deal ?
Why we shouldn't be worried?
a) That's a regression and
b) we have no chance to load a document once the server sends text/xml by mistake
Updated•19 years ago
|
Assignee: nobody → xml
Component: General → XML
Product: Firefox → Core
QA Contact: general → ashshbhatt
Version: unspecified → 1.8 Branch
Comment 3•19 years ago
|
||
(In reply to comment #2)
> Why we shouldn't be worried?
> a) That's a regression and
> b) we have no chance to load a document once the server sends text/xml by
> mistake
>
oh I see now, didn't understood very well your bug description.
but the build you're using is more than a month old, did you verified with newer builds?
Comment 4•19 years ago
|
||
Could you attach / point to a testcase please? I couldn't reproduce the bug easily.
Keywords: regression
Comment 5•18 years ago
|
||
This is true for both 1.8 branch and trunk.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Summary: XMLHttpRequest doesn't load invalid XML files → [XMLHttpRequest] responseXML contains error document for invalid XML files
Comment 6•18 years ago
|
||
This is alert(r.responseXML.documentElement.textContent). r.responseXML should have been null.
Comment 7•18 years ago
|
||
Btw, responseText does not contain the error document but the real response.
Updated•17 years ago
|
Updated•17 years ago
|
Comment 8•11 years ago
|
||
Gecko has this old feature where XML parser outputs a document with error info if parsing fails. This is wrong per spec and other implementations
Test cases:
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/responsexml-media-type.htm
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/responsexml-non-well-formed.htm
Depends on: 289714
Comment 9•8 years ago
|
||
This bug seems like a dupe of bug 289714, which was just fixed. The web platform tests in comment 8 are now passing, and XHRs made by web content for invalid XML documents will now give a null responseXML instead of a <parsererror> document (and the parsing failure will be logged to the web console).
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•