Merge pull request #194 from t4skforce/master

Support for HTTP query parameters
pull/208/head
Hunter Long 2019-06-06 12:19:14 -07:00 committed by GitHub
commit 1efd3224ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -90,17 +90,11 @@ func (s *Service) parseHost() string {
if s.Type == "tcp" || s.Type == "udp" { if s.Type == "tcp" || s.Type == "udp" {
return s.Domain return s.Domain
} else { } else {
domain := s.Domain u, err := url.Parse(s.Domain)
hasPort, _ := regexp.MatchString(`\:([0-9]+)`, domain)
if hasPort {
splitDomain := strings.Split(s.Domain, ":")
domain = splitDomain[len(splitDomain)-2]
}
host, err := url.Parse(domain)
if err != nil { if err != nil {
return s.Domain return s.Domain
} }
return host.Host return strings.Split(u.Host, ":")[0]
} }
} }