1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Sanitize service endpoint by adding/reving slash when needed. (#1821)

* Sanitize service endpoint by adding/reving slash when needed.
This commit is contained in:
Maria Carmina 2024-06-25 10:24:15 +03:00 committed by GitHub
parent 1f4e4336dd
commit b060bc153f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,10 @@ export class Provider {
const endpoint: ServiceEndpoint = {
serviceName: i,
method: endpoints.serviceEndpoints[i][0],
urlPath: providerEndpoint + endpoints.serviceEndpoints[i][1]
urlPath:
providerEndpoint.replace(/\/+$/, '') +
'/' +
endpoints.serviceEndpoints[i][1].replace(/^\/+/, '')
}
serviceEndpoints.push(endpoint)
}