Closed Bug 720801 Opened 14 years ago Closed 13 years ago

XMLHttpResponses with server responses 304 attempts to generate responseXML resulting in "no element found" error

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
trivial

Tracking

()

RESOLVED DUPLICATE of bug 411060

People

(Reporter: jukefox, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C) Steps to reproduce: I have a website which sends out an XMLHttpRequest which does not expect a result from the server. It is just to inform the server about a particular action. In consequence the server answers with HTTP status code 304. Actual results: The error "no element found" is being displayed in the error console. Expected results: There should be no entry about this in the error console.
Need a testcase
Please refer to ticket "http://code.google.com/p/fbug/issues/detail?id=3100" in the Firebug-project. Here you can find links to test cases with source code etc.
fyi: I checked that behaviour in versions 3.6 and 7 as well with the same result.
This is caused by the XMLparser that expects the page to provide a valid XML page
Do you agree with me that this is a bug or is it incorrect to use an XML-request to simply inform the server about a particular action?
It's a trivial bug, but indeed a bug.
Severity: normal → trivial
Status: UNCONFIRMED → NEW
Component: Untriaged → Networking: HTTP
Ever confirmed: true
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: untriaged → networking.http
Hardware: x86_64 → All
Summary: XMLHttpResponses with status 304 generate "no element found" error → XMLHttpResponses with server responses 304 attempts to generate responseXML resulting in "no element found" error
Version: 9 Branch → Trunk
OK. Thanks for your quick response.
So the exact response the server sends is this: HTTP/1.1 304 Not Modified Server: nginx Date: Tue, 24 Jan 2012 22:29:30 GMT Connection: keep-alive Keep-Alive: timeout=20 The relevant part of the spec seems to be http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#response-entity-body which says that the "response entity body" should be null in this case. Then in http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#document-response-entity-body step 1 we would bail out. In practice, we should probably just not set up the parser until we actually have some data (so not until the first OnDataAvailable call), right? Nothing to do with HTTP.
Component: Networking: HTTP → DOM
QA Contact: networking.http → general
Though of course nothing in the spec defines what we should or should not say in an error console...
Same problem with 204 responses.
There's already a bug for this - bug 411060. Both have a lot of information.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.