Closed
Bug 377671
Opened 17 years ago
Closed 8 years ago
XMLHttpRequest request truncated at null character ('\0')
Categories
(Core :: XML, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: h2g2bob, Unassigned)
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-UK; rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-2) It was me, I was the turkey all along Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-UK; rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-2) //create a string containing a NULL character var text = "WELCOME" + String.fromCharCode(0) + "HELLO WORLD!!"; alert("Text length is " + String(text.length)); //send text as POST to example.com var hx = new XMLHttpRequest; hx.open('POST', "http://example.com", true); hx.onreadystatechange = function () { ; } hx.setRequestHeader("Content-Type", "application/x-example"); hx.send(text); Reproducible: Always Steps to Reproduce: 1. 2. 3.
Reporter | ||
Comment 1•17 years ago
|
||
Code above only sends "WELCOME" part and stops at NULL character. If string starts with zero char then no data part is sent.
Summary: XMLHttpRequest incorrectly handles characcer 0 → XMLHttpRequest incorrectly handles character 0 for HTTP POST
Updated•17 years ago
|
Assignee: nobody → xml
Component: General → XML
Product: Firefox → Core
QA Contact: general → ashshbhatt
Summary: XMLHttpRequest incorrectly handles character 0 for HTTP POST → XMLHttpRequest request truncated at null character ('\0')
Comment 2•17 years ago
|
||
definitely a bug on the 1.8 branch: http://lxr.mozilla.org/mozilla1.8/source/content/base/src/nsXMLHttpRequest.cpp#1548 not sure about trunk...
Updated•15 years ago
|
Assignee: xml → nobody
QA Contact: ashshbhatt → xml
Comment 3•8 years ago
|
||
It seems this bug can be closed. On today's nightly, the example above now sends the full text to the server (confirmed with a trivial PHP script that simply outputs the POST body it received).
Flags: needinfo?(bugs)
Comment 4•8 years ago
|
||
Feel free to resolve as worksforme. If there are still issues, one can always reopen the bug or file a new one.
Flags: needinfo?(bugs)
Updated•8 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•