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

Commit 56b12fa

Browse files
authored
Merge pull request #420 from ipanova/i5527
Docker-Distribution-API-Version should be present among response head…
2 parents dfd5677 + 4911085 commit 56b12fa

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGES/5527.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add Docker-Distribution-API-Version header among response headers.

pulp_docker/app/registry.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
log = logging.getLogger(__name__)
1616

17+
v2_headers = MultiDict()
18+
v2_headers['Docker-Distribution-API-Version'] = 'registry/2.0'
19+
1720

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

101104
async def tags_list(self, request):
102105
"""
@@ -111,7 +114,7 @@ async def tags_list(self, request):
111114
if isinstance(c, Tag):
112115
tags['tags'].add(c.name)
113116
tags['tags'] = list(tags['tags'])
114-
return web.json_response(tags)
117+
return web.json_response(tags, headers=v2_headers)
115118

116119
async def get_tag(self, request):
117120
"""

0 commit comments

Comments
 (0)