mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28: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 = context.req.url
|
||||
.replace(config.http.base_url, config.frontend.url)
|
||||
.replace(baseUrlWithHttp, config.frontend.url);
|
||||
const replacedUrl = new URL(
|
||||
new URL(context.req.url).pathname,
|
||||
config.frontend.url,
|
||||
).toString();
|
||||
|
||||
await dualLogger.log(
|
||||
LogLevel.Debug,
|
||||
|
|
|
|||
Loading…
Reference in a new issue