allow HEAD on ACI images

Fixes #911.
This commit is contained in:
Jimmy Zelinskie 2016-02-11 17:00:38 -05:00
parent a9c64545fa
commit 2b07b6d8a9
5 changed files with 11 additions and 7 deletions

View file

@ -114,7 +114,7 @@ class SwiftStorage(BaseStorage):
logger.exception('Could not head object: %s', path)
return None
def get_direct_download_url(self, object_path, expires_in=60, requires_cors=False):
def get_direct_download_url(self, object_path, expires_in=60, requires_cors=False, head=False):
if requires_cors:
return None
@ -137,7 +137,7 @@ class SwiftStorage(BaseStorage):
object_path = self._normalize_path(object_path)
# Generate the signed HMAC body.
method = 'GET'
method = 'HEAD' if head else 'GET'
expires = int(time() + expires_in)
full_path = '%s/%s/%s' % (path, self._swift_container, object_path)