Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #420 from ipanova/i5527
Browse files Browse the repository at this point in the history
Docker-Distribution-API-Version should be present among response head…
  • Loading branch information
ipanova authored Oct 2, 2019
2 parents dfd5677 + 4911085 commit 56b12fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/5527.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add Docker-Distribution-API-Version header among response headers.
7 changes: 5 additions & 2 deletions pulp_docker/app/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

log = logging.getLogger(__name__)

v2_headers = MultiDict()
v2_headers['Docker-Distribution-API-Version'] = 'registry/2.0'


class ArtifactNotFound(Exception):
"""
Expand Down Expand Up @@ -96,7 +99,7 @@ async def serve_v2(request):
The docker client uses this endpoint to discover that the V2 API is available.
"""
return web.json_response({})
return web.json_response({}, headers=v2_headers)

async def tags_list(self, request):
"""
Expand All @@ -111,7 +114,7 @@ async def tags_list(self, request):
if isinstance(c, Tag):
tags['tags'].add(c.name)
tags['tags'] = list(tags['tags'])
return web.json_response(tags)
return web.json_response(tags, headers=v2_headers)

async def get_tag(self, request):
"""
Expand Down

0 comments on commit 56b12fa

Please sign in to comment.