diff options
author | Daniel Lindsley <daniel@toastdriven.com> | 2013-05-10 15:09:58 -0700 |
---|---|---|
committer | Daniel Lindsley <daniel@toastdriven.com> | 2013-05-10 15:09:58 -0700 |
commit | 5269d8277a0c2d6b78749dc86f3f903397ae5f71 (patch) | |
tree | 5579cfa4674ac03e1c5f20bcc28b16f8ece71234 /boto/auth.py | |
parent | 3c588657d640e0446e9a6e3cafd445158b2c4f31 (diff) | |
download | boto-5269d8277a0c2d6b78749dc86f3f903397ae5f71.tar.gz |
Fixed a bug where URIs were properly canonicalized in Sig V4 signatures.
Diffstat (limited to 'boto/auth.py')
-rw-r--r-- | boto/auth.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/boto/auth.py b/boto/auth.py index c5ff8fe8..43177ba3 100644 --- a/boto/auth.py +++ b/boto/auth.py @@ -32,13 +32,14 @@ import boto.auth_handler import boto.exception import boto.plugin import boto.utils +import copy +import datetime +from email.utils import formatdate import hmac +import os import sys -import urllib import time -import datetime -import copy -from email.utils import formatdate +import urllib from boto.auth_handler import AuthHandler from boto.exception import BotoClientError @@ -375,7 +376,11 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys): return ';'.join(l) def canonical_uri(self, http_request): - return http_request.auth_path + # Normalize the path. + normalized = os.path.normpath(http_request.auth_path) + # Then urlencode whatever's left. + encoded = urllib.quote(normalized) + return encoded def payload(self, http_request): body = http_request.body |