mirror of
https://github.com/doyensec/safeurl.git
synced 2025-05-13 21:07:38 +02:00
13 lines
235 B
Go
13 lines
235 B
Go
package safeurl
|
|
|
|
import "strings"
|
|
|
|
func isAllowedHost(host string, allowedHosts []string) bool {
|
|
host = strings.ToLower(host)
|
|
for _, allowedHost := range allowedHosts {
|
|
if host == allowedHost {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
} |