1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

fix default cdn endpoint for message attachments

This commit is contained in:
Samuel 2021-10-18 11:02:08 +02:00 committed by GitHub
parent 021fe5cffd
commit 508fbce94e

View File

@ -119,7 +119,7 @@ router.get("/", async (req: Request, res: Response) => {
x.attachments?.forEach((x) => { x.attachments?.forEach((x) => {
// dynamically set attachment proxy_url in case the endpoint changed // dynamically set attachment proxy_url in case the endpoint changed
const uri = x.proxy_url.startsWith("http") ? x.proxy_url : `https://example.org${x.proxy_url}`; const uri = x.proxy_url.startsWith("http") ? x.proxy_url : `https://example.org${x.proxy_url}`;
x.proxy_url = `${endpoint == null ? "http://localhost:3003" : endpoint}${new URL(uri).pathname}`; x.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`;
}); });
return x; return x;