Files
distribution/internal
Artem Tkachuk 2f1a51dc72 client: add Accept headers to Exists() HEAD
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>
2025-10-13 23:52:12 -07:00
..
2025-07-31 06:54:27 +00:00