supporting httpretty requests

This commit is contained in:
Jack Danger 2017-09-22 10:44:55 -07:00
parent ea66a71765
commit 390fe85137

View File

@ -547,8 +547,12 @@ class ResponseObject(_TemplateEnvironmentMixin):
# ACL and checking for the mere presence of an Authorization
# header.
if 'Authorization' not in request.headers:
if hasattr(request, 'url'):
signed_url = 'Signature=' in request.url
elif hasattr(request, 'requestline'):
signed_url = 'Signature=' in request.path
key = self.backend.get_key(bucket_name, key_name)
signed_url = 'Signature=' in request.url
if key:
if not key.acl.public_read and not signed_url:
return 403, {}, ""