summaryrefslogtreecommitdiff
path: root/internal/federation/federatingactor.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/federation/federatingactor.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/federation/federatingactor.go')
-rw-r--r--internal/federation/federatingactor.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/federation/federatingactor.go b/internal/federation/federatingactor.go
index 81f3c3281..8fc47462d 100644
--- a/internal/federation/federatingactor.go
+++ b/internal/federation/federatingactor.go
@@ -143,10 +143,12 @@ func (f *federatingActor) PostInboxScheme(ctx context.Context, w http.ResponseWr
have not yet applied authorization (ie., blocks).
*/
- // Obtain the activity; reject unknown activities.
- activity, errWithCode := ap.ResolveIncomingActivity(r)
+ // Resolve the activity, rejecting badly formatted / transient.
+ activity, ok, errWithCode := ap.ResolveIncomingActivity(r)
if errWithCode != nil {
return false, errWithCode
+ } else if !ok { // transient
+ return false, nil
}
// Set additional context data. Primarily this means