summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authoroliverpool <git@olivier.pfad.fr>2024-03-19 16:10:20 +0100
committeroliverpool <git@olivier.pfad.fr>2024-03-24 07:12:31 +0100
commit7b576d0a5d9f3cae067ff81d6a942b66a4deac3d (patch)
tree2a0d4fcda2a4f6988f6b70b4cc834e8304d30120 /routers
parentactions artifacts: warn instead of error on invalid request (diff)
downloadforgejo-7b576d0a5d9f3cae067ff81d6a942b66a4deac3d.tar.xz
forgejo-7b576d0a5d9f3cae067ff81d6a942b66a4deac3d.zip
activitypub: warn instead of error
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/activitypub/reqsignature.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/api/v1/activitypub/reqsignature.go b/routers/api/v1/activitypub/reqsignature.go
index 59ebc74b89..6003f664a0 100644
--- a/routers/api/v1/activitypub/reqsignature.go
+++ b/routers/api/v1/activitypub/reqsignature.go
@@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/modules/activitypub"
"code.gitea.io/gitea/modules/httplib"
+ "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
gitea_context "code.gitea.io/gitea/services/context"
@@ -89,7 +90,8 @@ func verifyHTTPSignatures(ctx *gitea_context.APIContext) (authenticated bool, er
func ReqHTTPSignature() func(ctx *gitea_context.APIContext) {
return func(ctx *gitea_context.APIContext) {
if authenticated, err := verifyHTTPSignatures(ctx); err != nil {
- ctx.ServerError("verifyHttpSignatures", err)
+ log.Warn("verifyHttpSignatures failed: %v", err)
+ ctx.Error(http.StatusBadRequest, "reqSignature", "request signature verification failed")
} else if !authenticated {
ctx.Error(http.StatusForbidden, "reqSignature", "request signature verification failed")
}