1
0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-02-28 19:50:44 +00:00

17 lines
269 B
Go
Raw Normal View History

2020-11-25 19:01:53 +08:00
package internet
import (
"net"
"strings"
)
func IsValidHTTPHost(request string, config string) bool {
r := strings.ToLower(request)
c := strings.ToLower(config)
if strings.Contains(r, ":") {
h, _, _ := net.SplitHostPort(r)
return h == c
}
return r == c
}