From f9bfafa0048bbcec2fc6b8277abf3f37f5ab2abe Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 2 Oct 2024 10:25:08 +0200 Subject: [PATCH] quick out addPAth --- models/peer/peer_cache.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/models/peer/peer_cache.go b/models/peer/peer_cache.go index 6f8debc..545a3ae 100644 --- a/models/peer/peer_cache.go +++ b/models/peer/peer_cache.go @@ -34,14 +34,13 @@ func (p *PeerCache) urlFormat(url string, dt utils.DataType) string { // localhost is replaced by the local peer URL // because localhost must collide on a web request security protocol if strings.Contains(url, "localhost") || strings.Contains(url, "127.0.0.1") { - url = strings.ReplaceAll(url, "localhost", dt.API()) - url = strings.ReplaceAll(url, "127.0.0.1", dt.API()) r := regexp.MustCompile("(:[0-9]+)") t := r.FindString(url) if t != "" { - url = strings.Replace(url, t, ":8080", -1) + url = strings.Replace(url, t, "", -1) } - r.ReplaceAllString(url, ":8080") + url = strings.ReplaceAll(url, "localhost", dt.API()+":8080") + url = strings.ReplaceAll(url, "127.0.0.1", dt.API()+":8080") } return url }