[backend/federation] Add extra guard clauses to ActivityHandlerService
This should be caught by InboxValidationMiddleware, but more checks are always a good idea.
This commit is contained in:
parent
d4cda86228
commit
d36fa802d8
1 changed files with 3 additions and 0 deletions
|
@ -52,6 +52,9 @@ public class ActivityHandlerService(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (resolvedActor.IsLocalUser)
|
||||||
|
throw GracefulException.UnprocessableEntity("Refusing to process activity for local user");
|
||||||
|
|
||||||
if (new Uri(activity.Actor.Id).Host != new Uri(activity.Id).Host)
|
if (new Uri(activity.Actor.Id).Host != new Uri(activity.Id).Host)
|
||||||
throw GracefulException
|
throw GracefulException
|
||||||
.UnprocessableEntity($"Activity identifier ({activity.Id}) host doesn't match actor identifier ({activity.Actor.Id}) host");
|
.UnprocessableEntity($"Activity identifier ({activity.Id}) host doesn't match actor identifier ({activity.Actor.Id}) host");
|
||||||
|
|
Loading…
Add table
Reference in a new issue