Dont set duplicate context for activities (#4233)

fix_admins_query
Nutomic 2023-12-05 17:19:12 +01:00 committed by GitHub
parent a5386187e3
commit de85e51fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -96,6 +96,13 @@ pub(crate) async fn get_activity(
if sensitive { if sensitive {
Ok(HttpResponse::Forbidden().finish()) Ok(HttpResponse::Forbidden().finish())
} else { } else {
create_apub_response(&activity.data) // Don't use create_apub_response() to avoid duplicate context (the activity stored in db
// already includes context).
let json = serde_json::to_string_pretty(&activity.data)?;
Ok(
HttpResponse::Ok()
.content_type(FEDERATION_CONTENT_TYPE)
.body(json),
)
} }
} }