Fix some bugs with resume support.
This commit is contained in:
parent
f40b7dbc54
commit
c40f6abb7a
1 changed files with 5 additions and 4 deletions
|
@ -111,9 +111,10 @@ def head_image_layer(namespace, repository, image_id, headers):
|
||||||
# downloads.
|
# downloads.
|
||||||
if store.get_supports_resumeable_downloads(repo_image.storage.locations):
|
if store.get_supports_resumeable_downloads(repo_image.storage.locations):
|
||||||
profile.debug('Storage supports resumeable downloads')
|
profile.debug('Storage supports resumeable downloads')
|
||||||
extra_headers['Accept-Ranges'] = 'bytes';
|
extra_headers['Accept-Ranges'] = 'bytes'
|
||||||
|
|
||||||
resp = make_response('')
|
resp = make_response('')
|
||||||
|
resp.headers.extend(headers)
|
||||||
resp.headers.extend(extra_headers)
|
resp.headers.extend(extra_headers)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
@ -146,7 +147,7 @@ def get_image_layer(namespace, repository, image_id, headers):
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
profile.debug('Streaming layer data')
|
profile.debug('Streaming layer data')
|
||||||
return Response(store.stream_read(repo_image.storage.locations, path), headers=dict(headers, **extra_headers))
|
return Response(store.stream_read(repo_image.storage.locations, path), headers=headers)
|
||||||
except (IOError, AttributeError):
|
except (IOError, AttributeError):
|
||||||
profile.debug('Image not found')
|
profile.debug('Image not found')
|
||||||
abort(404, 'Image %(image_id)s not found', issue='unknown-image',
|
abort(404, 'Image %(image_id)s not found', issue='unknown-image',
|
||||||
|
|
Reference in a new issue