Issue metadata
Sign in to add a comment
|
Two edge cases about URLSearchParams objects serializing
Reported by
l446240525@gmail.com,
May 6 2016
|
||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2724.0 Safari/537.36
Steps to reproduce the problem:
> new Request("",{body:new URLSearchParams("a=\0"),method:"post"}).text().then(console.log)
a= // should be a=%00
> new Request("",{body:new URLSearchParams("a=\n"),method:"post"}).text().then(console.log)
a=%0D%0A // should be a=%0A
What is the expected behavior?
What went wrong?
spec: https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer
Did this work before? N/A
Chrome version: 52.0.2724.0 Channel: n/a
OS Version: OS X 10.10.4
Flash Version: Shockwave Flash 22.0 r0
,
May 10 2016
,
May 11 2016
for (let i = 0; i < 256; i++) {
let char = String.fromCharCode(i)
new Request("", {
body: new URLSearchParams(`=${char}`),
method: "post"
}).text().then(function(text) {
if (text !== new URLSearchParams(`=${char}`).toString()) {
console.log(escape(char))
}
})
}
,
May 11 2016
,
May 18 2016
See https://bugs.chromium.org/p/chromium/issues/detail?id=557063#c6 and https://bugs.chromium.org/p/chromium/issues/detail?id=557063#c7 regarding CR/LF normalization. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by rohitrao@chromium.org
, May 9 2016Components: Blink>DOM