diff --git a/web/service/sub.go b/web/service/sub.go index 3a2bba23..6de6cfcf 100644 --- a/web/service/sub.go +++ b/web/service/sub.go @@ -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) }