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

tokarchuk/v1.17
Kevin Zúñiga 4 years ago committed by GitHub
parent 2791cc139e
commit 247ab6a922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/context/api.go

@ -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.")
}
}

Loading…
Cancel
Save