From b4fecbc51719a33d09be1e76d55ae0eec11fb71a Mon Sep 17 00:00:00 2001 From: Lambda Date: Wed, 28 Aug 2024 17:59:45 +0000 Subject: [PATCH] client/media: work around matrix-media-repo bug It rejects Authenticated Media requests if X-Matrix values aren't unnecessarily quoted: https://github.com/t2bot/matrix-media-repo/issues/609 --- src/api/client_server/media.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/client_server/media.rs b/src/api/client_server/media.rs index 9b653944..cd117232 100644 --- a/src/api/client_server/media.rs +++ b/src/api/client_server/media.rs @@ -331,7 +331,9 @@ pub(crate) async fn get_remote_content( response } Err(Error::Federation(_, error)) - if error.error_kind() == Some(&ErrorKind::Unrecognized) => + if error.error_kind() == Some(&ErrorKind::Unrecognized) + // https://github.com/t2bot/matrix-media-repo/issues/609 + || error.error_kind() == Some(&ErrorKind::Unauthorized) => { info!( "Remote server does not support authenticated media, falling \ @@ -795,7 +797,9 @@ pub(crate) async fn get_remote_thumbnail( response } Err(Error::Federation(_, error)) - if error.error_kind() == Some(&ErrorKind::Unrecognized) => + if error.error_kind() == Some(&ErrorKind::Unrecognized) + // https://github.com/t2bot/matrix-media-repo/issues/609 + || error.error_kind() == Some(&ErrorKind::Unauthorized) => { info!( "Remote server does not support authenticated media, falling \