Skip to content

Commit a98a4f3

Browse files
authored
Fix Docker registry Accept header for broader compatibility (#131)
1 parent 33a177f commit a98a4f3

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