mirror of
https://github.com/distribution/distribution.git
synced 2025-12-26 01:14:31 +00:00
The manifest Exists() client call issued a HEAD without any Accept headers. Some OCI-focused registries require an explicit Accept for manifest content negotiation, causing HEAD to fail (404/406) even when the manifest exists. The Get() path already sets Accept; Exists() did not. This change adds all supported manifest media types from distribution.ManifestMediaTypes() as Accept headers to the Exists() HEAD request, aligning behavior with Get() and improving OCI interoperability. Tests: - Regression: Exists() returns true when Accept is present and false when stripped (negative path), mirroring real-world behavior. Risk/compatibility: - Low. Registries that ignore Accept on HEAD continue to work. - Redirect handling is unchanged; existing CheckRedirect preserves Accept. Signed-off-by: Artem Tkachuk <artemtkachuk@yahoo.com>