forgot to strip protocol

This commit is contained in:
murdle 2025-12-27 22:25:58 +02:00
parent 23f4ef1070
commit 64a4d6b2be

View File

@ -171,10 +171,19 @@ export class SpacebarServer extends Server {
"utf8"
);
const baseUrl =
Config.get().api.endpointPublic
?.split("/api")[0]
?.replace(/^https?:/, "") ?? "";
const cdnUrl =
Config.get().cdn.endpointPublic
?.replace(/^https?:/, "") ?? "";
html = html
.replaceAll("%BASE_URL%", Config.get().api.endpointPublic?.split("/api")[0] ?? "")
.replaceAll("%BASE_URL%", baseUrl)
.replaceAll("%GATEWAY_URL%", Config.get().gateway.endpointPublic ?? "")
.replaceAll("%CDN_URL%", Config.get().cdn.endpointPublic ?? "")
.replaceAll("%CDN_URL%", cdnUrl)
.replaceAll("%VAPID_KEY%", Config.get().webPush.publicVapidKey ?? "");
res.type("html").send(html);