Send Docker-Content-Digest headers on GET requests

Fixes #955
This commit is contained in:
Joseph Schorr 2015-11-23 13:56:34 -05:00
parent c9b1a02e9c
commit a0e597f957

View file

@ -228,7 +228,9 @@ def fetch_manifest_by_tagname(namespace, repo_name, manifest_ref):
if repo is not None:
track_and_log('pull_repo', repo)
return make_response(manifest.json_data, 200)
response = make_response(manifest.json_data, 200)
response.headers['Docker-Content-Digest'] = manifest.digest
return response
@v2_bp.route(MANIFEST_DIGEST_ROUTE, methods=['GET'])
@ -246,7 +248,9 @@ def fetch_manifest_by_digest(namespace, repo_name, manifest_ref):
if repo is not None:
track_and_log('pull_repo', repo)
return make_response(manifest.json_data, 200)
response = make_response(manifest.json_data, 200)
response.headers['Docker-Content-Digest'] = manifest.digest
return response
@v2_bp.route(MANIFEST_TAGNAME_ROUTE, methods=['PUT'])