Skip to content

Commit

Permalink
make additional test without host substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed May 22, 2024
1 parent dd563d6 commit a0a08a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ func TestService_MatchServerRegex(t *testing.T) {
// regex servers
{Server: "test-prefix\\.(.*)", SrcMatch: *regexp.MustCompile("^/(.*)"),
Dst: "http://127.0.0.1:8080/$host/blah/$1", MatchType: MTProxy, dead: false},
{Server: "(.*)\\.test-domain\\.(com|org)", SrcMatch: *regexp.MustCompile("^/"),
Dst: "http://127.0.0.2:8080/", MatchType: MTProxy, dead: false},
{Server: "(.*)\\.test-domain\\.(com|org)", SrcMatch: *regexp.MustCompile("^/bar/(.*)"),
Dst: "http://127.0.0.2:8080/$1/foo", MatchType: MTProxy, dead: false},

// strict match
{Server: "test-prefix.exact.com", SrcMatch: *regexp.MustCompile("/"),
Expand Down Expand Up @@ -236,8 +236,8 @@ func TestService_MatchServerRegex(t *testing.T) {
{
name: "regex server with test-domain.org match",
server: "another-prefix.test-domain.org",
src: "/",
res: Matches{MTProxy, []MatchedRoute{{Destination: "http://127.0.0.2:8080/", Alive: true}}},
src: "/bar/123",
res: Matches{MTProxy, []MatchedRoute{{Destination: "http://127.0.0.2:8080/123/foo", Alive: true}}},
},
{
name: "regex server with test-domain.net mismatch",
Expand Down

0 comments on commit a0a08a8

Please sign in to comment.