summaryrefslogtreecommitdiff
path: root/internal/federation/authenticate.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-03-06 09:38:43 +0000
committerLibravatar GitHub <noreply@github.com>2023-03-06 10:38:43 +0100
commitd8d5818b47009f28433a7e96bcce8d116c8a9769 (patch)
treea93b7fe7deaa286fde5eab450b4cb30fbe7566dd /internal/federation/authenticate.go
parent[feature] Add support for profile fields (#1483) (diff)
downloadgotosocial-d8d5818b47009f28433a7e96bcce8d116c8a9769.tar.xz
[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 <grufwub@gmail.com> * add code commenting for gtserror functions Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/federation/authenticate.go')
-rw-r--r--internal/federation/authenticate.go3
1 files changed, 2 insertions, 1 deletions
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 {