0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00

use path package for matching content type

content type always uses forward slash, so path is the right package to
use.

fixes #191
This commit is contained in:
Will Norris 2019-11-01 18:57:14 -07:00
parent c0a97f6742
commit d99be34251

View file

@ -30,7 +30,7 @@ import (
"mime" "mime"
"net/http" "net/http"
"net/url" "net/url"
"path/filepath" "path"
"strings" "strings"
"time" "time"
@ -280,7 +280,7 @@ func contentTypeMatches(patterns []string, contentType string) bool {
} }
for _, pattern := range patterns { for _, pattern := range patterns {
if ok, err := filepath.Match(pattern, contentType); ok && err == nil { if ok, err := path.Match(pattern, contentType); ok && err == nil {
return true return true
} }
} }