mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
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
|
||
|
}
|