Case insensitive host rule

This commit is contained in:
Benjamin Gandon 2018-10-25 10:18:03 +02:00 committed by Traefiker Bot
parent 22ee8700ca
commit aa26927d61
4 changed files with 45 additions and 5 deletions

View file

@ -53,6 +53,12 @@ func newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash,
varsN := make([]string, len(idxs)/2)
varsR := make([]*regexp.Regexp, len(idxs)/2)
pattern := bytes.NewBufferString("")
// Host matching is case insensitive
if matchHost {
fmt.Fprint(pattern, "(?i)")
}
pattern.WriteByte('^')
reverse := bytes.NewBufferString("")
var end int