From 67e11a1a613bea9b7f5ac81a5f3bb2cd6c47b105 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 18 Jan 2024 16:11:13 +0000 Subject: [chore] chore rationalise http return codes for activitypub handlers (#2540) * some small code fixups and changes * add check in ResolveIncomingActivity for transient activity types (i.e. activity ID is nil) * update test to handle new transient behaviour --- internal/api/activitypub/users/inboxpost_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/api/activitypub/users/inboxpost_test.go') diff --git a/internal/api/activitypub/users/inboxpost_test.go b/internal/api/activitypub/users/inboxpost_test.go index 2791f8110..715231ecc 100644 --- a/internal/api/activitypub/users/inboxpost_test.go +++ b/internal/api/activitypub/users/inboxpost_test.go @@ -478,15 +478,17 @@ func (suite *InboxPostTestSuite) TestPostEmptyCreate() { targetAccount = suite.testAccounts["local_account_1"] ) - // Post a create with no object. + // Post a create with no object, this + // should get accepted and silently dropped + // as the lack of ID marks it as transient. create := streams.NewActivityStreamsCreate() suite.inboxPost( create, requestingAccount, targetAccount, - http.StatusBadRequest, - `{"error":"Bad Request: missing ActivityStreams id property"}`, + http.StatusAccepted, + `{"status":"Accepted"}`, suite.signatureCheck, ) } -- cgit v1.2.3