[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
This commit is contained in:
kim
2024-01-18 16:11:13 +00:00
committed by GitHub
parent 906639ad7e
commit 67e11a1a61
5 changed files with 29 additions and 30 deletions

View File

@@ -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,
)
}