mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-18 05:25:49 +00:00
17 lines
269 B
Go
17 lines
269 B
Go
|
|
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
|
||
|
|
}
|