url format improved
This commit is contained in:
parent
3bbde50f96
commit
3c14c64f4a
@ -44,6 +44,8 @@ func (p *PeerCache) urlFormat(url string, dt tools.DataType) string {
|
||||
t := r.FindString(url)
|
||||
if t != "" {
|
||||
url = strings.Replace(url, t, dt.API()+":8080", -1)
|
||||
} else {
|
||||
strings.ReplaceAll(url, localhost, dt.API()+":8080")
|
||||
}
|
||||
} else {
|
||||
url = url + "/" + dt.API()
|
||||
@ -86,6 +88,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string,
|
||||
meth := methods[method] // Get the method url to execute
|
||||
meth = strings.ReplaceAll(meth, ":id", dataID) // Replace the id in the url in case of a DELETE / UPDATE method (it's a standard naming in OC)
|
||||
url := ""
|
||||
|
||||
// Check the status of the peer
|
||||
if mypeer, ok := p.checkPeerStatus(peerID, dt.API(), caller); !ok {
|
||||
// If the peer is not reachable, add the execution to the failed executions list
|
||||
|
Loading…
Reference in New Issue
Block a user