handle input url edge cases (#3004)

* handle input url edge cases

* remove extra url logic
dev
Tarun Koyalwar 2022-12-08 20:04:32 +05:30 committed by GitHub
parent 36fac42eef
commit e4ae90885b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ func (h *Helper) convertInputToType(input string, inputType inputType, defaultPo
notURL := !strings.Contains(input, "://")
parsed, _ := url.Parse(input)
var host, port string
if !notURL {
if !notURL && parsed != nil {
host, port, _ = net.SplitHostPort(parsed.Host)
} else {
host, port, _ = net.SplitHostPort(input)