1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-19 16:13:58 +01:00

Send error message when CSRF token is missing (#13676)

This commit is contained in:
Kevin Zúñiga 2020-11-23 02:56:04 -05:00 committed by GitHub
parent 2791cc139e
commit 247ab6a922
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -169,7 +169,7 @@ func (ctx *APIContext) RequireCSRF() {
if len(headerToken) > 0 || len(formValueToken) > 0 {
csrf.Validate(ctx.Context.Context, ctx.csrf)
} else {
ctx.Context.Error(401)
ctx.Context.Error(401, "Missing CSRF token.")
}
}