Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-04-25 14:09:09 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-04-25 14:09:09 +0300
commitae55fdc38a3be89d2b02bca263e1e74b317c640c (patch)
tree796ba6f0ef224111ad9177debe3930948bb53e3a
parentcc3ff61ae215bdaec0c1ae0c3ee232156015c6b4 (diff)
fix bug in http link without host
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
-rw-r--r--web/service/sub.go6
1 files changed, 5 insertions, 1 deletions
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)
}