diff options
author | James Saryerwinnie <js@jamesls.com> | 2012-09-28 09:25:47 -0700 |
---|---|---|
committer | James Saryerwinnie <js@jamesls.com> | 2012-09-28 09:31:48 -0700 |
commit | eef606ddb7df94be988ad7981e9f1e8eb91ec325 (patch) | |
tree | 27e415950779ae4091c5e2b12f07ba95eed7686a /boto/auth.py | |
parent | f545e1034892c393b7a31db9e1d5304a3837420f (diff) | |
download | boto-eef606ddb7df94be988ad7981e9f1e8eb91ec325.tar.gz |
Condense multiple whitespace into a single space
For sigv4, when computing the cononical headers, any inner
whitespace should be condensed to a single whitespace:
'x-amz-foo: foo bar baz'
'x-amx-foo: foo bar baz'
Otherwise the signature will be incorrect.
Diffstat (limited to 'boto/auth.py')
-rw-r--r-- | boto/auth.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/boto/auth.py b/boto/auth.py index 29f9ac53..81261241 100644 --- a/boto/auth.py +++ b/boto/auth.py @@ -352,9 +352,9 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys): case, sorting them in alphabetical order and then joining them into a string, separated by newlines. """ - l = ['%s:%s' % (n.lower().strip(), - headers_to_sign[n].strip()) for n in headers_to_sign] - l = sorted(l) + l = sorted(['%s:%s' % (n.lower().strip(), + ' '.join(headers_to_sign[n].strip().split())) + for n in headers_to_sign]) return '\n'.join(l) def signed_headers(self, headers_to_sign): |