summaryrefslogtreecommitdiff
path: root/boto/auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'boto/auth.py')
-rw-r--r--boto/auth.py15
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