mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 Fix frontend proxy breaking when host is different than base_url
This commit is contained in:
parent
51cbb22eb0
commit
ae3d5813cf
9
index.ts
9
index.ts
|
|
@ -86,11 +86,10 @@ app.all("*", async (context) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseUrlWithHttp = config.http.base_url.replace("https://", "http://");
|
const replacedUrl = new URL(
|
||||||
|
new URL(context.req.url).pathname,
|
||||||
const replacedUrl = context.req.url
|
config.frontend.url,
|
||||||
.replace(config.http.base_url, config.frontend.url)
|
).toString();
|
||||||
.replace(baseUrlWithHttp, config.frontend.url);
|
|
||||||
|
|
||||||
await dualLogger.log(
|
await dualLogger.log(
|
||||||
LogLevel.Debug,
|
LogLevel.Debug,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue