From 2aff584ce3f0ea5e23124d229a2552ebbb4c9922 Mon Sep 17 00:00:00 2001 From: karo Date: Fri, 17 Apr 2026 11:33:18 +0200 Subject: [PATCH] fix(oci): store manifests with correct mediaType in blob storage 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. --- internal/commands/UploadManifest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/commands/UploadManifest.go b/internal/commands/UploadManifest.go index 5d8b6b1..0f2eeba 100644 --- a/internal/commands/UploadManifest.go +++ b/internal/commands/UploadManifest.go @@ -32,7 +32,7 @@ func HandleUploadManifest(ctx context.Context, command UploadManifest) (*UploadM dbContext := ioc.GetDependency[db.Context](scope) blobService := ioc.GetDependency[blobStorage.Service](scope) - uploadResponse, err := blobService.UploadCompleteBlob(ctx, command.Digest, bytes.NewReader(command.Body), blobStorage.BlobContentTypeManifest) + uploadResponse, err := blobService.UploadCompleteBlob(ctx, command.Digest, bytes.NewReader(command.Body), blobStorage.BlobContentType(command.MediaType)) if err != nil { return nil, fmt.Errorf("uploading blob: %w", err) }