1
0
Fork 0
forked from alemi/upub

fix: activity redirects when fetching different id

This commit is contained in:
əlemi 2024-04-30 01:49:05 +02:00
parent 3df01b5b0a
commit 63ba54dad9
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -12,7 +12,10 @@ pub async fn view(
) -> crate::Result<JsonLD<serde_json::Value>> {
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()