Disable legacy media request fallbacks by default.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -1318,6 +1318,12 @@ pub struct Config {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub allow_legacy_media: bool,
|
pub allow_legacy_media: bool,
|
||||||
|
|
||||||
|
/// Fallback to requesting legacy unauthenticated media from remote servers.
|
||||||
|
/// Unauthenticated media was removed in ~2024Q3; enabling this adds
|
||||||
|
/// considerable federation requests which are unlikely to succeed.
|
||||||
|
#[serde(default)]
|
||||||
|
pub request_legacy_media: bool,
|
||||||
|
|
||||||
#[serde(default = "true_fn")]
|
#[serde(default = "true_fn")]
|
||||||
pub freeze_legacy_media: bool,
|
pub freeze_legacy_media: bool,
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ pub async fn fetch_remote_thumbnail(
|
|||||||
.fetch_thumbnail_authenticated(mxc, user, server, timeout_ms, dim)
|
.fetch_thumbnail_authenticated(mxc, user, server, timeout_ms, dim)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
if let Err(Error::Request(NotFound, ..)) = &result {
|
if let Err(Error::Request(NotFound, ..)) = &result
|
||||||
|
&& self.services.server.config.request_legacy_media
|
||||||
|
{
|
||||||
return self
|
return self
|
||||||
.fetch_thumbnail_unauthenticated(mxc, user, server, timeout_ms, dim)
|
.fetch_thumbnail_unauthenticated(mxc, user, server, timeout_ms, dim)
|
||||||
.await;
|
.await;
|
||||||
@@ -58,7 +60,9 @@ pub async fn fetch_remote_content(
|
|||||||
.fetch_content_authenticated(mxc, user, server, timeout_ms)
|
.fetch_content_authenticated(mxc, user, server, timeout_ms)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
if let Err(Error::Request(NotFound, ..)) = &result {
|
if let Err(Error::Request(NotFound, ..)) = &result
|
||||||
|
&& self.services.server.config.request_legacy_media
|
||||||
|
{
|
||||||
return self
|
return self
|
||||||
.fetch_content_unauthenticated(mxc, user, server, timeout_ms)
|
.fetch_content_unauthenticated(mxc, user, server, timeout_ms)
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
@@ -1130,6 +1130,12 @@
|
|||||||
#
|
#
|
||||||
#allow_legacy_media = false
|
#allow_legacy_media = false
|
||||||
|
|
||||||
|
# Fallback to requesting legacy unauthenticated media from remote servers.
|
||||||
|
# Unauthenticated media was removed in ~2024Q3; enabling this adds
|
||||||
|
# considerable federation requests which are unlikely to succeed.
|
||||||
|
#
|
||||||
|
#request_legacy_media = false
|
||||||
|
|
||||||
# This item is undocumented. Please contribute documentation for it.
|
# This item is undocumented. Please contribute documentation for it.
|
||||||
#
|
#
|
||||||
#freeze_legacy_media = true
|
#freeze_legacy_media = true
|
||||||
|
|||||||
Reference in New Issue
Block a user