New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 609716 link

Starred by 4 users

Issue metadata

Status: Duplicate
Merged: issue 557063
Owner: ----
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



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
 
Screen Shot 2016-05-06 at 2.34.45 PM.png
57.2 KB View Download
Cc: mkwst@chromium.org
Components: Blink>DOM
Is there any reason to believe this would be Mac-only?

+mkwst who landed the initial implementation of URLSearchParams.
Components: -Blink>DOM Blink>Network>FetchAPI
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))
        }
    })
}

Comment 4 by sigbjo...@opera.com, May 11 2016

Mergedinto: 557063
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment