Use ctx.ServerError in reqsignature.go
This commit is contained in:
parent
28fd3e796e
commit
f602958f3c
|
@ -94,7 +94,7 @@ func verifyHTTPSignatures(ctx *gitea_context.APIContext) (authenticated bool, er
|
||||||
func ReqHTTPSignature() func(ctx *gitea_context.APIContext) {
|
func ReqHTTPSignature() func(ctx *gitea_context.APIContext) {
|
||||||
return func(ctx *gitea_context.APIContext) {
|
return func(ctx *gitea_context.APIContext) {
|
||||||
if authenticated, err := verifyHTTPSignatures(ctx); err != nil {
|
if authenticated, err := verifyHTTPSignatures(ctx); err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, "verifyHttpSignatures", err)
|
ctx.ServerError("verifyHttpSignatures", err)
|
||||||
} else if !authenticated {
|
} else if !authenticated {
|
||||||
ctx.Error(http.StatusForbidden, "reqSignature", "request signature verification failed")
|
ctx.Error(http.StatusForbidden, "reqSignature", "request signature verification failed")
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue