From 275e066364dc004d80b6f9dae90c373ce39b93cb Mon Sep 17 00:00:00 2001 From: Aldo Lacuku Date: Thu, 12 Dec 2024 15:09:28 +0100 Subject: [PATCH] fix(mediaType): do not omit the original media type if not a well-known media type While converting a media type to a human-friendly one, we omit the original one when handling unknown media types. Usually, we convert the media type when logging errors, so keeping the original media type when reporting an error is important. Signed-off-by: Aldo Lacuku --- pkg/oci/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/oci/types.go b/pkg/oci/types.go index 5609070d..ae4aefdd 100644 --- a/pkg/oci/types.go +++ b/pkg/oci/types.go @@ -88,8 +88,8 @@ func HumanReadableMediaType(s string) string { return string(Asset) } - // should never happen - return "" + // If we do not have a match for a well known mediaType then we return the original mediaType. + return s } // ArtifactTypeSlice is a slice of ArtifactType, can be passed as comma separated values.