Merge pull request #965 from coreos-inc/v2header

Send Docker-Content-Digest headers on GET requests
This commit is contained in:
josephschorr 2015-11-23 13:58:59 -05:00
commit cd4d94207b

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'])