New issue
Advanced search Search tips

Issue 658956 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Copy as cURL on post requests does not build post data correctly

Reported by g...@scopey.co.nz, Oct 25 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce the problem:
1. Create a POST request with more than one POST value
2. After posting, copy as curl (not "all")

Test script (I used jsbin):

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<form method="POST" action="/?three=bin&four=baz">
  <input name="one" value="foo">
  <input name="two" value="bar">
  <input type="submit">
</form>
</body>
</html>

What is the expected behavior?
Valid cURL data is copied, no additional characters.

What went wrong?
In the serailised post data and the GET query string a carat (^) appears after every value.

Did this work before? Yes 53.0.2785.143

Chrome version: 54.0.2840.71  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
curl.PNG
9.7 KB View Download

Comment 1 by woxxom@gmail.com, Oct 25 2016

Indeed, cmd-escaping via ^ is not needed inside doubleqouted strings on Windows. It actually produces the wrong result as the escape characters are preserved.

Comment 2 by woxxom@gmail.com, Oct 25 2016

Broken by https://crrev.com/2182213006
Cc: woxxom@gmail.com
Labels: M-56
Owner: allada@chromium.org
Status: Assigned (was: Unconfirmed)
As per comment #2 this bug seems to be caused of BUG= 505391 . Hence, assigning to developer for further action.

Comment 4 by allada@chromium.org, Oct 25 2016

This isn't a bug... It looks like you are using Windows but pasting into a linux terminal? This is because we are sniffing out the OS of the host machine and using it to decide which type of bash to escape the characters with.

Maybe adding a checkbox in the setting to allow you to force an it to copy in windows or linux style would be better?

Comment 5 by woxxom@gmail.com, Oct 25 2016

#4 is wrong. This IS a bug that can be EASILY checked in a couple of seconds. Run the following in a standard command prompt:

echo "a=1^&b=2"

and you'll see that everything inside doublequotes is preserved, which is exactly the purpose of doublequotes.

ESCAPING VIA ^ IS NOT NEEDED INSIDE DOUBLEQUOTES ON WINDOWS.

Comment 6 by allada@chromium.org, Oct 25 2016

I see, url fragments are being escaped with double quotes as well.

Comment 7 by g...@scopey.co.nz, Oct 26 2016

WRT comment #4, if there ever is a point where you sniff the OS to check what format to provide then I think a checkbox to control that behaviour is definitely required.

Remember that Windows actually ships with an inbuilt Ubuntu VM (beta) since the anniversary edition.
Labels: Hotlist-Polish
Owner: chenwilliam@chromium.org
Owner: eostroukhov@chromium.org
Owner: jarhar@chromium.org

Sign in to add a comment