From ae55fdc38a3be89d2b02bca263e1e74b317c640c Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 25 Apr 2023 14:39:09 +0330 Subject: [PATCH] fix bug in http link without host Co-Authored-By: Alireza Ahmadi --- 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 263b15c3..ba70fe43 100644 --- a/web/service/sub.go +++ b/web/service/sub.go @@ -590,7 +590,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) }