From 88c88cac5bc9312de54bd938899d2a9a3043f610 Mon Sep 17 00:00:00 2001 From: pb Date: Thu, 13 Mar 2025 16:57:27 +0100 Subject: [PATCH] testing simplyfied urlFormat() method which works thanks to traefik --- models/peer/peer_cache.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/models/peer/peer_cache.go b/models/peer/peer_cache.go index 13fb5a3..789c0e1 100644 --- a/models/peer/peer_cache.go +++ b/models/peer/peer_cache.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "regexp" "strings" "cloud.o-forge.io/core/oc-lib/tools" @@ -32,7 +31,7 @@ type PeerCache struct { func (p *PeerCache) urlFormat(hostUrl string, dt tools.DataType) string { // localhost is replaced by the local peer URL // because localhost must collide on a web request security protocol - localhost := "" + /*localhost := "" if strings.Contains(hostUrl, "localhost") { localhost = "localhost" } @@ -47,9 +46,9 @@ func (p *PeerCache) urlFormat(hostUrl string, dt tools.DataType) string { } else { hostUrl = strings.ReplaceAll(hostUrl, localhost, dt.API()+":8080/oc") } - } else { - hostUrl = hostUrl + "/" + strings.ReplaceAll(dt.API(), "oc-", "") - } + } else {*/ + hostUrl = hostUrl + "/" + strings.ReplaceAll(dt.API(), "oc-", "") + //} fmt.Println("Contacting", hostUrl) return hostUrl }