upd
This commit is contained in:
16
internal/domain/domain.go
Normal file
16
internal/domain/domain.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package domain
|
||||
|
||||
import "strings"
|
||||
|
||||
func HostWithoutPort(host string) string {
|
||||
host = strings.TrimSpace(strings.ToLower(host))
|
||||
if i := strings.IndexByte(host, ':'); i >= 0 {
|
||||
return host[:i]
|
||||
}
|
||||
return host
|
||||
}
|
||||
|
||||
func IsMckoDomain(host string) bool {
|
||||
host = HostWithoutPort(host)
|
||||
return strings.Contains(host, ".mcko.") || strings.HasPrefix(host, "mcko.")
|
||||
}
|
||||
Reference in New Issue
Block a user