From ba1d0051b44fdd242b20899e195e37ab26501516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 11 Mar 2021 09:18:01 +0100 Subject: media: Make Type comparable So we can use it and output.Format as map key etc. This commit also fixes the media.Type implementation so it does not need to mutate itself to handle different suffixes for the same MIME type, e.g. jpg vs. jpeg. This means that there are no Suffix or FullSuffix on media.Type anymore. Fixes #8317 Fixes #8324 --- deploy/deploy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/deploy.go b/deploy/deploy.go index 1aaae5aa7..c75461750 100644 --- a/deploy/deploy.go +++ b/deploy/deploy.go @@ -432,7 +432,7 @@ func (lf *localFile) ContentType() string { } ext := filepath.Ext(lf.NativePath) - if mimeType, found := lf.mediaTypes.GetFirstBySuffix(strings.TrimPrefix(ext, ".")); found { + if mimeType, _, found := lf.mediaTypes.GetFirstBySuffix(strings.TrimPrefix(ext, ".")); found { return mimeType.Type() } -- cgit v1.2.3