fix: strip out any port
This commit is contained in:
parent
53f9a8fb32
commit
d2c9f8e38a
|
@ -230,7 +230,11 @@ func (s *S5API) Routes() (*httprouter.Router, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *S5API) Can(w http.ResponseWriter, r *http.Request) bool {
|
func (s *S5API) Can(w http.ResponseWriter, r *http.Request) bool {
|
||||||
resolve, err := dnslink.Resolve(r.Host)
|
host := r.Host
|
||||||
|
if strings.Contains(host, ":") {
|
||||||
|
host = strings.Split(host, ":")[0]
|
||||||
|
}
|
||||||
|
resolve, err := dnslink.Resolve(host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue