diff options
author | Kevin Zúñiga <kevin.zun@gmail.com> | 2020-11-23 02:56:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-23 07:56:04 +0000 |
commit | 247ab6a92205c67f4fce6e1e2146cfd4adc869f9 (patch) | |
tree | 66b996bdda8e33523f43070859100aed1f8e575d /modules/context | |
parent | 2791cc139e809856f894cd9dfcfceb9c4a9b8865 (diff) | |
download | gitea-247ab6a92205c67f4fce6e1e2146cfd4adc869f9.tar.gz gitea-247ab6a92205c67f4fce6e1e2146cfd4adc869f9.zip |
Send error message when CSRF token is missing (#13676)
Diffstat (limited to 'modules/context')
-rw-r--r-- | modules/context/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/context/api.go b/modules/context/api.go index b5f521f63c..aa4b6b9e89 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.") } } |