Skip to content

Commit 75c21ff

Browse files
committed
Fix Docker registry Accept header for broader compatibility
Change-Id: Iaaff42819287cafdd6e98ee47fb5a594f581fec4
1 parent 0bbc5b9 commit 75c21ff

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

python/src/etos_api/library/docker.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,17 @@ async def head(
6969
:param token: Optional authorization token.
7070
:return: HTTP response.
7171
"""
72-
headers = {"Accept": "application/vnd.oci.image.index.v1+json"}
72+
# Accept OCI and Docker manifest formats (single-arch and multi-arch) for registry compatibility
73+
headers = {
74+
"Accept": ", ".join(
75+
[
76+
"application/vnd.oci.image.index.v1+json",
77+
"application/vnd.oci.image.manifest.v1+json",
78+
"application/vnd.docker.distribution.manifest.v2+json",
79+
"application/vnd.docker.distribution.manifest.list.v2+json",
80+
]
81+
)
82+
}
7383
if token is not None:
7484
headers["Authorization"] = f"Bearer {token}"
7585
self.logger.info("Making HEAD request with headers: %r", headers)

0 commit comments

Comments
 (0)