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:
Kieran Spear
2013-11-11 13:39:02 +11:00
parent 6a865eab33
commit bede0a0eb6

View File

@@ -95,7 +95,7 @@ def request(url, method='GET', headers=None, original_ip=None, debug=False,
if method:
string_parts.append(' -X %s' % method)
string_parts.append(' %s' % url)
string_parts.append(" '%s'" % url)
if headers:
for header in six.iteritems(headers):