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
This commit is contained in:
Lambda 2024-08-28 17:59:45 +00:00
parent 3fe0110649
commit b4fecbc517

View file

@ -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 \