Closed
Bug 337434
Opened 19 years ago
Closed 14 years ago
implement XMLHttpRequest.responseBody
Categories
(Core :: XML, enhancement)
Core
XML
Tracking
()
RESOLVED
DUPLICATE
of bug 572522
People
(Reporter: stephen.deken, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file, 1 obsolete file)
|
2.00 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
When fetching a binary file using XMLHttpRequest, the response contained in responseText is mangled. Characters above 0x7f are translated into U+FFFD, effectively destroying the file. This happens without regard to the content-type or charset specified in the headers.
Reproducible: Always
Steps to Reproduce:
1. Create an XMLHttpRequest object.
2. Perform a GET on a binary file (a file with octets above 0x7f).
3. Examine the results for the U+FFFD codepoint (which should not be present).
See upcoming testcase.
| Reporter | ||
Comment 1•19 years ago
|
||
This uses an image from Bugzilla, but all binary files are affected. I originally saw it using a TrueType font file that had been transmitted as text/plain, and the bug persisted even after I changed the content-type to application/octet-stream.
Comment 2•19 years ago
|
||
what happens if you use xtp.overrideMimeType("text/plain; charset=ISO-8859-1"); (after open, before send)?
| Reporter | ||
Comment 3•19 years ago
|
||
With that coercion, the result is better -- octets with the 0x80 bit set are translated into unicode code points, which (in theory) could be reverse-mapped into the original values. However, this is ugly and should not be necessary.
Here's another testcase which lets you try other files, content types, etc. If there's a combination that actually handles binary data, that would be sufficient.
Attachment #221590 -
Attachment is obsolete: true
Comment 4•19 years ago
|
||
-> enhancement, this doesn't sound like a bug to me
Severity: normal → enhancement
There is plans to make a responseBody property available that contains the raw data received from the server. However it is not yet defined what data type this member will be of.
It will hopefully be defined as part of the XHR2 spec, so please voice your opinions there.
Summary: XMLHttpRequest mangles binary data → implement XMLHttpRequest.responseBody
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•16 years ago
|
Assignee: xml → nobody
QA Contact: ashshbhatt → xml
Comment 6•15 years ago
|
||
Is typed array (i.e. Uint8Array) usable until ByteArray is defined in ECMA-262 spec?
Comment 7•14 years ago
|
||
Implemented as .mozResponseArrayBuffer.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•