From e1e6b7f0b92639c9bbdbee83b09f758d76543cfa Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 6 Apr 2022 23:17:52 +0800 Subject: [PATCH] fix --- modules/context/csrf.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/context/csrf.go b/modules/context/csrf.go index 8d179ca904748..66ea6bd0a3999 100644 --- a/modules/context/csrf.go +++ b/modules/context/csrf.go @@ -229,6 +229,7 @@ func Csrfer(opt CsrfOptions, ctx *Context) CSRF { } } + needsNew = needsNew || ctx.Req.Method == "GET" // If this request is a Get request, it will generate a new token, make sure the token is always up-to-date. if needsNew { // FIXME: actionId. x.Token = GenerateToken(x.Secret, x.ID, "POST")