authelia/internal/authorization/domain_matcher.go
2020-02-19 09:15:09 +11:00

14 lines
368 B
Go

package authorization
import "strings"
func isDomainMatching(domain string, domainRule string) bool {
if domain == domainRule { // if domain matches exactly
return true
} else if strings.HasPrefix(domainRule, "*.") && strings.HasSuffix(domain, domainRule[1:]) {
// If domain pattern starts with *, it's a multi domain pattern.
return true
}
return false
}