diff --git a/frontend/src/atoms/settings.ts b/frontend/src/atoms/settings.ts index 0c5e82a..1e87a4f 100644 --- a/frontend/src/atoms/settings.ts +++ b/frontend/src/atoms/settings.ts @@ -141,12 +141,16 @@ export const serverURL = atom((get) => export const rpcWebSocketEndpoint = atom((get) => { const proto = window.location.protocol === 'https:' ? 'wss:' : 'ws:' - return `${proto}//${get(serverAddressAndPortState)}/rpc/ws` + const sap = get(serverAddressAndPortState) + + return `${proto}//${sap.endsWith('/') ? sap.slice(0, -1) : sap}/rpc/ws` }) export const rpcHTTPEndpoint = atom((get) => { const proto = window.location.protocol - return `${proto}//${get(serverAddressAndPortState)}/rpc/http` + const sap = get(serverAddressAndPortState) + + return `${proto}//${sap.endsWith('/') ? sap.slice(0, -1) : sap}/rpc/http` }) export const serverSideCookiesState = atom>(async (get) => await pipe(