Closed
Bug 540854
Opened 16 years ago
Closed 16 years ago
XMLHttpRequest truncates UTF-8 encoded strings containing Code Point 0x00
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: johann.borck, Assigned: smaug)
Details
Attachments
(1 file)
3.55 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5
Build Identifier: Gecko/20091216 Firefox 3.5.6
when sending an UTF-8 encoded string using XMLHttpRequest (method POST), that contains the Code Point 0, the content is truncated at the position of the 0x00-byte. The Content-Length is set accordingly: if the first byte in the string is a 0x00, the content-length will also be 0.
Reproducible: Always
Steps to Reproduce:
1. send a utf-8 encoded string, that contains Codepoint 0 via XMLHttpRequest
2. use wireshark or something else to observe the bytes actually sent.
Actual Results:
the string is not being transmitted.
Expected Results:
the complete string should be transmitted.
are you using 0-terminated C-strings for this? OMG.
Comment 1•16 years ago
|
||
-> Core
Component's going to be a wild guess, but it'll get more attention there, anyhow.
Component: Developer Tools → DOM: Core & HTML
Product: Firefox → Core
QA Contact: developer.tools → general
Assignee | ||
Comment 2•16 years ago
|
||
A testcase would be great there.
(but I thinks where the problem is)
Assignee | ||
Comment 3•16 years ago
|
||
er, I think I know where the problem is.
Reporter | ||
Comment 4•16 years ago
|
||
(In reply to comment #2)
> A testcase would be great there.
Sure, is there a recommended (existing) environment, like a scriptable server for this kind of test?
Assignee | ||
Comment 5•16 years ago
|
||
Well, if you could upload the client side of the test?
a *minimal* testcase please.
Assignee | ||
Comment 6•16 years ago
|
||
Is this what you mean here?
http://mozilla.pettay.fi/xhr_upload/utf8_send.html
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → Olli.Pettay
Reporter | ||
Comment 7•16 years ago
|
||
yes, that's it, it also fails if the 0 is somewhere in the string:
function getUTF8() {
return String.fromCharCode(1,2,0,1,2,0);
}
Assignee | ||
Comment 8•16 years ago
|
||
I think we want this.
Btw, Opera has this same bug.
Attachment #422640 -
Flags: review?(jonas)
Assignee | ||
Updated•16 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Reporter | ||
Comment 9•16 years ago
|
||
definitely, very nice.
webkit/google chrome/(?safari?) also do, though only if 0 is the first byte.
Assignee | ||
Comment 10•16 years ago
|
||
I did test Safari 4 and Chrome and having 0 as the first byte works there
Reporter | ||
Comment 11•16 years ago
|
||
(In reply to comment #10)
> I did test Safari 4 and Chrome and having 0 as the first byte works there
os x or windows? I only tested chrome on linux
Reporter | ||
Comment 12•16 years ago
|
||
hm, seems I was wrong. it works now. Strange, I thought I noticed the bug on chrome first.. never mind.
Attachment #422640 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 13•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•