summaryrefslogtreecommitdiff
path: root/internal/federation/federatingprotocol.go
diff options
context:
space:
mode:
authorLibravatar tobi <tobi.smethurst@protonmail.com>2025-10-16 17:07:02 +0200
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-10-17 15:33:57 +0200
commitee4294af006cbf10c3061cf23ee16bb42b91ec3f (patch)
tree9a699288a850c90166d747538e0273026a8c7062 /internal/federation/federatingprotocol.go
parent[chore] Rationalize HTTP return codes for fedi endpoints, other tidying up (#... (diff)
downloadgotosocial-ee4294af006cbf10c3061cf23ee16bb42b91ec3f.tar.xz
[chore] Better handling of Gone accounts during `PostInbox` (return 202 Accepted instead of 401 Unauthorized) (#4506)v0.20.1
Follow up of https://codeberg.org/superseriousbusiness/gotosocial/pulls/4503 addressing something I missed! Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4506 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r--internal/federation/federatingprotocol.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go
index 2f6953257..990ce6a52 100644
--- a/internal/federation/federatingprotocol.go
+++ b/internal/federation/federatingprotocol.go
@@ -227,12 +227,13 @@ func (f *Federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
pubKeyAuth, errWithCode := f.AuthenticateFederatedRequest(ctx, receiver.Username)
if errWithCode != nil {
- // Check if we got an error code from a remote
+ // Check if we got code 410 Gone from a remote
// instance while trying to dereference the pub
- // key owner who's trying to post to this inbox.
+ // key owner who's trying to post to this inbox,
+ // or if we already had a tombstone stored for them.
if gtserror.StatusCode(errWithCode) == http.StatusGone {
- // If the pub key owner's key/account has gone
- // (410) then likely inbox post was a Delete.
+ // If the pub key owner's key/account has
+ // gone, then inbox post was likely a Delete.
//
// If so, we can just write 202 and leave, as
// either we'll have already processed any Deletes