Repository navigation
fix(registry): infer OCI manifest media type when omitted in payload (#1530) - #1533
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1530 by determining the effective manifest media type when
mediaTypeis omitted in the JSON response payload.Context & Root Cause
Under the OCI Image Index specification (and Image Manifest specification), the root
mediaTypeproperty inside the JSON payload is optional and frequently omitted by modern build tools (e.g. Docker Hub returnspassbolt/passbolt:5.17.0-1-cewith HTTP headerContent-Type: application/vnd.oci.image.index.v1+json, but nomediaTypein the body).When
responseManifests.mediaTypewas undefined,Registry.tsbypassed both the index branch and the single-platform manifest branch, throwingUnexpected error; no manifest foundand failing candidate tag resolution.Changes
Registry.ts, parse the HTTPContent-Typeheader (viagetHeaderContentType) as a fallback whenresponseManifests.mediaTypeis missing.manifestsarray -> OCI image index;config/layers-> OCI image manifest).mediaTypetoapplication/vnd.oci.image.manifest.v1+json.Registry.test.tscovering header fallback and structural inference for both multi-arch indexes and single-platform manifests.website/docs/changelog/next.md.