Closed
Bug 1331304
Opened 8 years ago
Closed 3 years ago
"Copy as cURL" leaves brackets unencoded, invoking cURL globbing
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1549773
People
(Reporter: site-mozilla-bugzilla, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20161213204132
Steps to reproduce:
1. Open the devtools Net Monitor
2. Go to https://www.example.com/?brackets[1-5]=foo
3. Select main request and "Copy as cURL"
4. Execute it
Actual results:
The generated command invokes curl's globbing URL parser, and makes 5 requests:
curl 'https://www.example.com/?brackets[1-5]=foo' -H 'Host: www.example.com' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'DNT: 1' -H 'Connection: keep-alive'
Curl makes 5 requests in series:
https://www.example.com/?brackets1=foo
https://www.example.com/?brackets2=foo
https://www.example.com/?brackets3=foo
https://www.example.com/?brackets4=foo
https://www.example.com/?brackets5=foo
When the query does not have a valid curl glob, such as ?brackets[foo]=bar I instead get an error:
curl: (3) [globbing] bad range in column 58
Expected results:
The "Copy as cURL" command should either include the --globoff option, or escape the []{} characters (as suggested by the option's documentation).
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All
Updated•8 years ago
|
Priority: -- → P3
Comment 1•6 years ago
|
||
The correct solution here is probably to URL-encode the brackets, as they aren't valid outside the hostname portion of the URL.
Updated•6 years ago
|
Product: Firefox → DevTools
Comment 2•6 years ago
|
||
to be honest a quick solution is to type -g onto the end of the CURL provided, and have firefox output with -g flag appended
Comment 3•6 years ago
|
||
Hm, yeah, that's probably better than URL-encoding (which would actually change the URL and produce a different query).
Should be as simple as slapping a `command.push("-g");` after `let command = ["curl"]` in curl.js (https://dxr.mozilla.org/mozilla-central/source/devtools/client/shared/curl.js#61).
Updated•5 years ago
|
Blocks: netmonitor-copy
Comment 4•3 years ago
|
||
This was fixed in bug 1549773, can someone close it?
Comment 5•3 years ago
|
||
Thanks for the note, marking as duplicate
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•