1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-09-05 18:41:00 +00:00

Merge branch 'only-fetch-media-requested-by-auth-endpoints' into 'next'

fix(media): only fetch remote media when requested by authenticated endpoints

See merge request famedly/conduit!764
This commit is contained in:
Matthias Ahouansou 2025-07-07 10:56:28 +00:00
commit 91c1b25b5b

View file

@ -215,7 +215,7 @@ pub async fn get_content(
content_type, content_type,
content_disposition: Some(content_disposition), content_disposition: Some(content_disposition),
}) })
} else if server_name != services().globals.server_name() && allow_remote { } else if server_name != services().globals.server_name() && allow_remote && authenticated {
let remote_content_response = get_remote_content(server_name, media_id.clone()).await?; let remote_content_response = get_remote_content(server_name, media_id.clone()).await?;
Ok(get_content::v1::Response { Ok(get_content::v1::Response {
@ -297,7 +297,7 @@ async fn get_content_as_filename(
.with_filename(Some(filename.clone())), .with_filename(Some(filename.clone())),
), ),
}) })
} else if server_name != services().globals.server_name() && allow_remote { } else if server_name != services().globals.server_name() && allow_remote && authenticated {
let remote_content_response = get_remote_content(server_name, media_id.clone()).await?; let remote_content_response = get_remote_content(server_name, media_id.clone()).await?;
Ok(get_content_as_filename::v1::Response { Ok(get_content_as_filename::v1::Response {