feat(GODT-3010): Do not log error when no MimeType provided to lower the noise.

This commit is contained in:
Romain LE JEUNE 2023-11-09 10:42:18 +01:00 committed by Romain Le Jeune
parent 21ff7b4b97
commit 8d3e04679f
1 changed files with 3 additions and 0 deletions

View File

@ -256,6 +256,9 @@ func DecodeCharset(original []byte, contentType string) ([]byte, error) {
// ParseMediaType from MIME doesn't support RFC2231 for non asci / utf8 encodings so we have to pre-parse it.
func ParseMediaType(v string) (string, map[string]string, error) {
if v == "" {
return "", nil, errors.New("empty media type")
}
decoded, err := DecodeHeader(v)
if err != nil {
logrus.WithField("value", v).WithError(err).Error("Media Type parsing error.")