Fix case sensitive host

This commit is contained in:
Emile Vauge 2016-10-14 16:04:09 +02:00
parent 084d00a156
commit e12ddca1a5
No known key found for this signature in database
GPG key ID: D808B4C167352E59
4 changed files with 33 additions and 19 deletions

View file

@ -36,7 +36,7 @@ func TestParseTwoRules(t *testing.T) {
serverRoute := &serverRoute{route: route}
rules := &Rules{route: serverRoute}
expression := "Host:foo.bar;Path:/foobar"
expression := "Host: Foo.Bar ; Path:/FOObar"
routeResult, err := rules.Parse(expression)
if err != nil {
@ -58,11 +58,13 @@ func TestParseDomains(t *testing.T) {
"Host:foo.bar,test.bar",
"Path:/test",
"Host:foo.bar;Path:/test",
"Host: Foo.Bar ;Path:/test",
}
domainsSlice := [][]string{
{"foo.bar", "test.bar"},
{},
{"foo.bar"},
{"foo.bar"},
}
for i, expression := range expressionsSlice {
domains, err := rules.ParseDomains(expression)