mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 03:59:17 +02:00
Fix #776: Don't store unhandled ActivityPub messages in database
This commit is contained in:
parent
b9b1e1e26a
commit
46f1d96206
3 changed files with 32 additions and 0 deletions
|
@ -121,6 +121,7 @@ def receive(activity, on_behalf_of):
|
|||
from . import models
|
||||
from . import serializers
|
||||
from . import tasks
|
||||
from .routes import inbox
|
||||
|
||||
# we ensure the activity has the bare minimum structure before storing
|
||||
# it in our database
|
||||
|
@ -128,6 +129,10 @@ def receive(activity, on_behalf_of):
|
|||
data=activity, context={"actor": on_behalf_of, "local_recipients": True}
|
||||
)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
if not inbox.get_matching_handlers(activity):
|
||||
# discard unhandlable activity
|
||||
return
|
||||
|
||||
if should_reject(
|
||||
fid=serializer.validated_data.get("id"),
|
||||
actor_id=serializer.validated_data["actor"].fid,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue