mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user