From 63ba54dad9b7a7c79aa0d002f02efab652fb9411 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 30 Apr 2024 01:49:05 +0200 Subject: [PATCH] fix: activity redirects when fetching different id --- src/routes/activitypub/activity.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/activitypub/activity.rs b/src/routes/activitypub/activity.rs index 864f86a3..3b6358f8 100644 --- a/src/routes/activitypub/activity.rs +++ b/src/routes/activitypub/activity.rs @@ -12,7 +12,10 @@ pub async fn view( ) -> crate::Result> { let aid = ctx.uri("activities", id); if auth.is_local() && query.fetch && !ctx.is_local(&aid) { - ctx.fetch_activity(&aid).await?; + let obj = ctx.fetch_activity(&aid).await?; + if obj.id != aid { + return Err(UpubError::Redirect(obj.id)); + } } let row = model::addressing::Entity::find_addressed()