Skip to content

Commit

Permalink
Issue #506: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Jun 10, 2018
1 parent 1fb35b1 commit 4ea9d1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions route/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ func TestTableLookup(t *testing.T) {
route add svc z.abc.com/foo/ http://foo.com:3100
route add svc *.abc.com/ http://foo.com:4000
route add svc *.abc.com/foo/ http://foo.com:5000
route add svc *.def.abc.com/ http://foo.com:6000
route add svc xyz.com:80/ https://xyz.com
`

Expand Down Expand Up @@ -610,6 +611,8 @@ func TestTableLookup(t *testing.T) {
{&http.Request{Host: ".abc.com", URL: mustParse("/foo/")}, "http://foo.com:5000"},
{&http.Request{Host: "x.y.abc.com", URL: mustParse("/foo/")}, "http://foo.com:5000"},
{&http.Request{Host: "y.abc.com:80", URL: mustParse("/foo/")}, "http://foo.com:5000"},
{&http.Request{Host: "x.def.abc.com", URL: mustParse("/")}, "http://foo.com:6000"},
{&http.Request{Host: "x.def.abc.com", URL: mustParse("/foo")}, "http://foo.com:6000"},
{&http.Request{Host: "y.abc.com:443", URL: mustParse("/foo/"), TLS: &tls.ConnectionState{}}, "http://foo.com:5000"},

// exact match has precedence over glob match
Expand Down

0 comments on commit 4ea9d1b

Please sign in to comment.