mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 17:12:26 -05: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:
parent
906639ad7e
commit
67e11a1a61
5 changed files with 29 additions and 30 deletions
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue