Use dns.IsSubDomain (#112)
For the match function use the proper thing from go dns. Fix all callers and tests to use this. Fixes: #107
This commit is contained in:
parent
842953f179
commit
25cf16af0e
8 changed files with 22 additions and 22 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue