From 247ab6a92205c67f4fce6e1e2146cfd4adc869f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Z=C3=BA=C3=B1iga?= Date: Mon, 23 Nov 2020 02:56:04 -0500 Subject: [PATCH] Send error message when CSRF token is missing (#13676) --- modules/context/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/context/api.go b/modules/context/api.go index b5f521f63c9..aa4b6b9e892 100644 --- a/modules/context/api.go +++ b/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.") } }