Skip to content

fix(oci): store manifests with correct mediaType in blob storage#52

Merged
The127 merged 1 commit intomasterfrom
fix/manifest-content-type-override
Apr 17, 2026
Merged

fix(oci): store manifests with correct mediaType in blob storage#52
The127 merged 1 commit intomasterfrom
fix/manifest-content-type-override

Conversation

@The127
Copy link
Copy Markdown
Owner

@The127 The127 commented Apr 17, 2026

Summary

  • DownloadBlob in both storage backends overrides the Content-Type response header from blob metadata
  • Manifests were always stored in blob storage with the hardcoded BlobContentTypeManifest = "application/vnd.oci.image.manifest.v1+json" constant, regardless of their actual type
  • This caused Docker v2 manifests to be served with Content-Type: application/vnd.oci.image.manifest.v1+json while the JSON body contained "mediaType": "application/vnd.docker.distribution.manifest.v2+json", triggering Docker's "if present, mediaType in manifest should be..." error on docker pull
  • Fix: pass the manifest's actual MediaType as the blob content type when uploading, so DownloadBlob sets the correct Content-Type

Test plan

  • docker push a Docker image to Dockyard, then docker pull it — should succeed without the mediaType error
  • docker push an OCI image, then docker pull — should still work
  • Verify Content-Type response header on GET /v2/.../manifests/... matches the manifest's mediaType

DownloadBlob overrides Content-Type from blob metadata, but manifests
were always stored with the hardcoded OCI content type regardless of
their actual type. This caused Docker v2 manifests to be served with
Content-Type: application/vnd.oci.image.manifest.v1+json while the
JSON body contained mediaType: application/vnd.docker.distribution.manifest.v2+json,
triggering Docker's "if present, mediaType in manifest should be" error.
@The127 The127 enabled auto-merge April 17, 2026 09:33
@The127 The127 merged commit 9cdb04b into master Apr 17, 2026
6 checks passed
@The127 The127 deleted the fix/manifest-content-type-override branch April 17, 2026 09:34
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.

1 participant