0
0
Fork 0

Add logging for rejected ActivityPub payloads and add tests (#10062)

This commit is contained in:
Eugen Rochko 2019-02-17 03:38:25 +01:00 committed by GitHub
parent 041ff5fa9a
commit 147b4c2c3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 539 additions and 327 deletions

View file

@ -180,4 +180,9 @@ class ActivityPub::Activity
def requested_through_relay?
@options[:relayed_through_account] && Relay.find_by(inbox_url: @options[:relayed_through_account].inbox_url)&.enabled?
end
def reject_payload!
Rails.logger.info("Rejected #{@json['type']} activity #{@json['id']} from #{@account.uri}#{@options[:relayed_through_account] && "via #{@options[:relayed_through_account].uri}"}")
nil
end
end