Skip to content

Commit

Permalink
fix(mediaType): do not omit the original media type if not a well-kno…
Browse files Browse the repository at this point in the history
…wn 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 <[email protected]>
  • Loading branch information
alacuku authored and poiana committed Dec 12, 2024
1 parent 5776706 commit 61d9c71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/oci/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 61d9c71

Please sign in to comment.