1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

go mod vendor

This commit is contained in:
Tom Limoncelli
2020-02-12 21:17:56 -05:00
parent f708f19535
commit 0f07d91f54
34 changed files with 705 additions and 930 deletions

View File

@ -12,8 +12,8 @@ import (
"regexp"
"sync"
"github.com/tdewolff/buffer"
"github.com/tdewolff/parse"
"github.com/tdewolff/parse/buffer"
)
// ErrNotExist is returned when no minifier exists for a given mimetype.
@ -112,11 +112,11 @@ func (m *M) Match(mediatype string) (string, map[string]string, MinifierFunc) {
mimetype, params := parse.Mediatype([]byte(mediatype))
if minifier, ok := m.literal[string(mimetype)]; ok { // string conversion is optimized away
return string(mimetype), params, minifier.Minify
} else {
for _, minifier := range m.pattern {
if minifier.pattern.Match(mimetype) {
return minifier.pattern.String(), params, minifier.Minify
}
}
for _, minifier := range m.pattern {
if minifier.pattern.Match(mimetype) {
return minifier.pattern.String(), params, minifier.Minify
}
}
return string(mimetype), params, nil