Fix image format detection for upper case extensions, e.g. JPG

This regression was introduced in 0.56.0.

Fixes #6137
This commit is contained in:
Bjørn Erik Pedersen
2019-07-30 08:53:50 +02:00
parent 00a238e32c
commit c62bbf7b11
3 changed files with 11 additions and 1 deletions

View File

@@ -209,7 +209,7 @@ func (r *Spec) newResource(sourceFs afero.Fs, fd ResourceSourceDescriptor) (reso
fd.RelTargetFilename = sourceFilename
}
ext := filepath.Ext(fd.RelTargetFilename)
ext := strings.ToLower(filepath.Ext(fd.RelTargetFilename))
mimeType, found := r.MediaTypes.GetFirstBySuffix(strings.TrimPrefix(ext, "."))
// TODO(bep) we need to handle these ambigous types better, but in this context
// we most likely want the application/xml type.