From 4a90408386327bc4c4a762cb1902454798ba28f4 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 4 Dec 2023 13:34:36 +0100 Subject: [PATCH] [backend] Don't proxy relative URLs This fixes the instance icon for the local instance not being rendered correctly. Resolves #426 --- packages/backend/src/models/repositories/drive-file.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index 4d6567e81..5d6200bc1 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -90,6 +90,7 @@ export const DriveFileRepository = db.getRepository(DriveFile).extend({ getFinalUrl(url: string): string { if (!config.proxyRemoteFiles) return url; + if (!url.startsWith('https://') && !url.startsWith('http://')) return url; if (url.startsWith(`${config.url}/files`)) return url; if (url.startsWith(`${config.url}/static-assets`)) return url; if (url.startsWith(`${config.url}/identicon`)) return url;