summaryrefslogtreecommitdiff
path: root/internal/api/activitypub/users/inboxpost_test.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-01-18 16:11:13 +0000
committerLibravatar GitHub <noreply@github.com>2024-01-18 17:11:13 +0100
commit67e11a1a613bea9b7f5ac81a5f3bb2cd6c47b105 (patch)
tree34a2a61c1bcf3b850dda1835b34f0d81d9844612 /internal/api/activitypub/users/inboxpost_test.go
parent[chore] update viper version (#2539) (diff)
downloadgotosocial-67e11a1a613bea9b7f5ac81a5f3bb2cd6c47b105.tar.xz
[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
Diffstat (limited to 'internal/api/activitypub/users/inboxpost_test.go')
-rw-r--r--internal/api/activitypub/users/inboxpost_test.go8
1 files changed, 5 insertions, 3 deletions
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,
)
}