From 7b7a0f9aa7d0d13e8bd2662d70a6751c51133055 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Tue, 25 Apr 2023 10:44:39 +0200 Subject: [PATCH] [sub] fix bug in http link without host --- web/service/sub.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) }