From d8d5818b47009f28433a7e96bcce8d116c8a9769 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:38:43 +0000 Subject: [bugfix] internal server error on search not found (#1590) * add error value wrapping, include status code / not found flags from transport errors, update error usages Signed-off-by: kim * add code commenting for gtserror functions Signed-off-by: kim --------- Signed-off-by: kim --- internal/federation/authenticate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/federation/authenticate.go') diff --git a/internal/federation/authenticate.go b/internal/federation/authenticate.go index a966bb26a..32e427542 100644 --- a/internal/federation/authenticate.go +++ b/internal/federation/authenticate.go @@ -25,6 +25,7 @@ import ( "encoding/pem" "errors" "fmt" + "net/http" "net/url" "strings" @@ -226,7 +227,7 @@ func (f *federator) AuthenticateFederatedRequest(ctx context.Context, requestedU // The actual http call to the remote server is made right here in the Dereference function. b, err := trans.Dereference(ctx, requestingPublicKeyID) if err != nil { - if errors.Is(err, transport.ErrGone) { + if gtserror.StatusCode(err) == http.StatusGone { // if we get a 410 error it means the account that owns this public key has been deleted; // we should add a tombstone to our database so that we can avoid trying to deref it in future if err := f.HandleGone(ctx, requestingPublicKeyID); err != nil { -- cgit v1.2.3