Closed Bug 423886 Opened 17 years ago Closed 8 years ago

XMLHttpRequest generates an exception when content-length is 0

Categories

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

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: WSourdeau, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.8.1.12) Gecko/20080129 Iceweasel/2.0.0.12 (Debian-2.0.0.12-2) Build Identifier: Whenever the content-type returned by the server is text/xml, XMLHttpRequest will try to decode it, even when the content is empty. This causes an exception to be thrown and the JS code to stop executing even though the JS code may not be interested in the parsed result. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Attached patch MochitestSplinter Review
Attached is a mochitest which passes a clean build from trunk. Do you set up your XMLHttpRequest in a different way? Is this still a problem?
Component: DOM: Mozilla Extensions → DOM
Unfortunately this bug cannot be reproduced with the information given. Doing a synchronous or asynchronous XHR to an XML file with Content-Length=0 and an XML Content-Type does not throw an exception now, but rather simply logs a console message that the file could not be parsed (no root element). If this bug still occurs, please re-open it with more precise steps so that we can reproduce it.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: