From 39c6cf733daf32c0d56864789bf6ebcf11c1e351 Mon Sep 17 00:00:00 2001 From: David Langley Date: Tue, 14 Apr 2026 10:49:01 +0100 Subject: [PATCH] add 7th param for authed media --- apps/web/src/modules/ClientApi.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/src/modules/ClientApi.ts b/apps/web/src/modules/ClientApi.ts index 778693d9e8..ae10eacbb1 100644 --- a/apps/web/src/modules/ClientApi.ts +++ b/apps/web/src/modules/ClientApi.ts @@ -55,8 +55,9 @@ export class ClientApi implements IClientApi { public async downloadMxc(mxcUrl: string): Promise { const client = MatrixClientPeg.safeGet(); - // useAuthentication=true produces the authenticated /_matrix/client/v1/media/download URL - const httpUrl = client.mxcUrlToHttp(mxcUrl, undefined, undefined, undefined, false, true); + // useAuthentication=true (7th param) produces /_matrix/client/v1/media/download + // which is required for servers that enforce authenticated media. + const httpUrl = client.mxcUrlToHttp(mxcUrl, undefined, undefined, undefined, false, true, true); if (!httpUrl) throw new Error(`Cannot resolve mxc URL: ${mxcUrl}`); const accessToken = client.getAccessToken(); const response = await fetch(httpUrl, {