fix: strip out any port

This commit is contained in:
Derrick Hammer 2024-03-03 06:40:50 -05:00
parent 53f9a8fb32
commit d2c9f8e38a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 1 deletions

View File

@ -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
} }