14 lines
368 B
Go
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
|
|
}
|