Added quotes to example echo in swift-temp-url

If the curl command is used exactly as in the help, the ampersand
in the signature is interpreted as an operator and the curl
command breaks. I am aware of developers who have wasted a lot of
time because of this.

Change-Id: I6468c9a098b56db8242a2cf2c23b7a4857bd8574
This commit is contained in:
Ellen Leahy 2016-07-21 11:27:59 +01:00 committed by Alistair Coles
parent 45080a5177
commit 7958638e8f
2 changed files with 9 additions and 4 deletions

View File

@ -40,13 +40,13 @@ if __name__ == '__main__':
print() print()
print('This can be used to form a URL to give out for the access ') print('This can be used to form a URL to give out for the access ')
print('allowed. For example:') print('allowed. For example:')
print(' echo https://swift-cluster.example.com`%s GET 60 ' print(' echo \\"https://swift-cluster.example.com`%s GET 60 '
'/v1/AUTH_account/c/o mykey`' % prog) '/v1/AUTH_account/c/o mykey`\\"' % prog)
print() print()
print('Might output:') print('Might output:')
print(' https://swift-cluster.example.com/v1/AUTH_account/c/o?' print(' "https://swift-cluster.example.com/v1/AUTH_account/c/o?'
'temp_url_sig=34d49efc32fe6e3082e411eeeb85bd8a&' 'temp_url_sig=34d49efc32fe6e3082e411eeeb85bd8a&'
'temp_url_expires=1323482948') 'temp_url_expires=1323482948"')
exit(1) exit(1)
method, seconds, path, key = argv[1:5] method, seconds, path, key = argv[1:5]
try: try:

View File

@ -178,3 +178,8 @@ storage host name. For example, prefix the path with
https://swift-cluster.example.com/v1/my_account/container/object https://swift-cluster.example.com/v1/my_account/container/object
?temp_url_sig=5c4cc8886f36a9d0919d708ade98bf0cc71c9e91 ?temp_url_sig=5c4cc8886f36a9d0919d708ade98bf0cc71c9e91
&temp_url_expires=1374497657 &temp_url_expires=1374497657
Note that if the above example is copied exactly, and used in a command
shell, then the ampersand is interpreted as an operator and the URL
will be truncated. Enclose the URL in quotation marks to avoid this.