diff options
Diffstat (limited to 'middleware/proxy')
-rw-r--r-- | middleware/proxy/upstream.go | 3 | ||||
-rw-r--r-- | middleware/proxy/upstream_test.go | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/middleware/proxy/upstream.go b/middleware/proxy/upstream.go index 52375323e..7f339c01f 100644 --- a/middleware/proxy/upstream.go +++ b/middleware/proxy/upstream.go @@ -238,6 +238,9 @@ func (u *staticUpstream) Select() *UpstreamHost { func (u *staticUpstream) IsAllowedPath(name string) bool { for _, ignoredSubDomain := range u.IgnoredSubDomains { + if dns.Name(name) == dns.Name(u.From()) { + return true + } if middleware.Name(name).Matches(ignoredSubDomain + u.From()) { return false } diff --git a/middleware/proxy/upstream_test.go b/middleware/proxy/upstream_test.go index 6f96d7ce2..3d69ca8fb 100644 --- a/middleware/proxy/upstream_test.go +++ b/middleware/proxy/upstream_test.go @@ -70,7 +70,7 @@ func TestAllowedPaths(t *testing.T) { for i, test := range tests { isAllowed := upstream.IsAllowedPath(test.name) if test.expected != isAllowed { - t.Errorf("Test %d: expected %v found %v", i+1, test.expected, isAllowed) + t.Errorf("Test %d: expected %v found %v for %s", i+1, test.expected, isAllowed, test.name) } } } |