17 lines
358 B
Go
17 lines
358 B
Go
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.")
|
|
}
|