From ee4294af006cbf10c3061cf23ee16bb42b91ec3f Mon Sep 17 00:00:00 2001 From: tobi Date: Thu, 16 Oct 2025 17:07:02 +0200 Subject: [chore] Better handling of Gone accounts during `PostInbox` (return 202 Accepted instead of 401 Unauthorized) (#4506) 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 Co-committed-by: tobi --- internal/federation/federatingprotocol.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'internal/federation/federatingprotocol.go') 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 -- cgit v1.2.3