Skip to content

fix(registry): infer OCI manifest media type when omitted in payload (#1530) - #1533

Merged
fmartinou merged 1 commit into
mainfrom
fix/1530_oci_manifest_missing_mediatype
Nov 6, 2026
Merged

fmartinou merged 1 commit into
mainfrom
fix/1530_oci_manifest_missing_mediatype

Conversation

@fmartinou

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1530 by determining the effective manifest media type when mediaType is omitted in the JSON response payload.

Context & Root Cause

Under the OCI Image Index specification (and Image Manifest specification), the root mediaType property inside the JSON payload is optional and frequently omitted by modern build tools (e.g. Docker Hub returns passbolt/passbolt:5.17.0-1-ce with HTTP header Content-Type: application/vnd.oci.image.index.v1+json, but no mediaType in the body).
When responseManifests.mediaType was undefined, Registry.ts bypassed both the index branch and the single-platform manifest branch, throwing Unexpected error; no manifest found and failing candidate tag resolution.

Changes

  • In Registry.ts, parse the HTTP Content-Type header (via getHeaderContentType) as a fallback when responseManifests.mediaType is missing.
  • When neither the payload nor the HTTP header defines a known manifest/index media type, infer the media type structurally (manifests array -> OCI image index; config/layers -> OCI image manifest).
  • In multi-arch index resolution, fallback missing child descriptor mediaType to application/vnd.oci.image.manifest.v1+json.
  • Added unit tests in Registry.test.ts covering header fallback and structural inference for both multi-arch indexes and single-platform manifests.
  • Added changelog entry in website/docs/changelog/next.md.

@fmartinou
fmartinou merged commit 4195d73 into main Nov 6, 2026
21 of 22 checks passed
@fmartinou
fmartinou deleted the fix/1530_oci_manifest_missing_mediatype branch November 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Failed to resolve candidate tags (Unexpected error; no manifest found)" for Passbolt

1 participant