summaryrefslogtreecommitdiff
path: root/internal/federation/federatingprotocol.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-04-03 13:57:07 +0100
committerLibravatar GitHub <noreply@github.com>2024-04-03 13:57:07 +0100
commit15ede4c1ea4e5a9f69b3f0ed72d94ce764ffed1d (patch)
treeb76e1fe10e2c900541776b02f1ef7f9aeb729340 /internal/federation/federatingprotocol.go
parent[bugfix] Set domain for empty-domain Friendica accounts (#2800) (diff)
downloadgotosocial-15ede4c1ea4e5a9f69b3f0ed72d94ce764ffed1d.tar.xz
[bugfix] improved authenticate post inbox error handling (#2803)
* improved PostInboxScheme() error handling / logging in case of failed auth * dumbass kim. returning err instead of errWithCode... * add checks for the slightly changed error handling in tests, add notes in codebase about the odd way of working
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r--internal/federation/federatingprotocol.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go
index 2c2da7b7b..f8e5b4c09 100644
--- a/internal/federation/federatingprotocol.go
+++ b/internal/federation/federatingprotocol.go
@@ -216,7 +216,6 @@ func (f *Federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
// If codes 400, 401, or 403, obey the go-fed
// interface by writing the header and bailing.
w.WriteHeader(errWithCode.Code())
- return ctx, false, nil
case http.StatusGone:
// If the requesting account's key has gone
// (410) then likely inbox post was a delete.
@@ -225,11 +224,11 @@ func (f *Federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
// know about the account anyway, so we can't
// do any further processing.
w.WriteHeader(http.StatusAccepted)
- return ctx, false, nil
- default:
- // Proper error.
- return ctx, false, err
}
+
+ // We still return the error
+ // for later request logging.
+ return ctx, false, errWithCode
}
if pubKeyAuth.Handshaking {