From c40f6abb7a0f165a8ac96d1e18260f74b5f746ce Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Mon, 7 Jul 2014 18:19:52 -0400 Subject: [PATCH] Fix some bugs with resume support. --- endpoints/registry.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/endpoints/registry.py b/endpoints/registry.py index cc2342fe4..19eedf1ce 100644 --- a/endpoints/registry.py +++ b/endpoints/registry.py @@ -111,12 +111,13 @@ def head_image_layer(namespace, repository, image_id, headers): # downloads. if store.get_supports_resumeable_downloads(repo_image.storage.locations): profile.debug('Storage supports resumeable downloads') - extra_headers['Accept-Ranges'] = 'bytes'; + extra_headers['Accept-Ranges'] = 'bytes' resp = make_response('') + resp.headers.extend(headers) resp.headers.extend(extra_headers) return resp - + abort(403) @@ -146,12 +147,12 @@ def get_image_layer(namespace, repository, image_id, headers): return resp 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): profile.debug('Image not found') abort(404, 'Image %(image_id)s not found', issue='unknown-image', image_id=image_id) - + abort(403)