Quote URL in curl output to handle query params
Copy and pasting the generated curl output into a shell doesn't work when the URL includes an ampersand, as the URL isn't quoted. Closes-Bug: #1249891 Change-Id: Ic3d7682a2c034e89c3367c858ea33510f8cbc7d4
This commit is contained in:
@@ -95,7 +95,7 @@ def request(url, method='GET', headers=None, original_ip=None, debug=False,
|
|||||||
if method:
|
if method:
|
||||||
string_parts.append(' -X %s' % method)
|
string_parts.append(' -X %s' % method)
|
||||||
|
|
||||||
string_parts.append(' %s' % url)
|
string_parts.append(" '%s'" % url)
|
||||||
|
|
||||||
if headers:
|
if headers:
|
||||||
for header in six.iteritems(headers):
|
for header in six.iteritems(headers):
|
||||||
|
Reference in New Issue
Block a user