[sub] fix bug in http link without host

This commit is contained in:
Alireza Ahmadi
2023-04-25 10:44:39 +02:00
parent 134e2236a6
commit 7b7a0f9aa7

View File

@@ -532,7 +532,11 @@ func searchHost(headers interface{}) string {
switch v.(type) {
case []interface{}:
hosts, _ := v.([]interface{})
return hosts[0].(string)
if len(hosts) > 0 {
return hosts[0].(string)
} else {
return ""
}
case interface{}:
return v.(string)
}