Skip to content

Commit 247ab6a

Browse files
authored
Send error message when CSRF token is missing (#13676)
1 parent 2791cc1 commit 247ab6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/context/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func (ctx *APIContext) RequireCSRF() {
169169
if len(headerToken) > 0 || len(formValueToken) > 0 {
170170
csrf.Validate(ctx.Context.Context, ctx.csrf)
171171
} else {
172-
ctx.Context.Error(401)
172+
ctx.Context.Error(401, "Missing CSRF token.")
173173
}
174174
}
175175

0 commit comments

Comments
 (0)