mirror of
https://github.com/astaxie/beego.git
synced 2025-02-16 23:17:06 +00:00
beego: enhance the XSRFKEY from 15 to 32 #620
This commit is contained in:
parent
3f7e91e6a4
commit
9083927c6a
@ -452,7 +452,7 @@ func (c *Controller) XsrfToken() string {
|
|||||||
} else {
|
} else {
|
||||||
expire = int64(XSRFExpire)
|
expire = int64(XSRFExpire)
|
||||||
}
|
}
|
||||||
token = string(utils.RandomCreateBytes(15))
|
token = string(utils.RandomCreateBytes(32))
|
||||||
c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire)
|
c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire)
|
||||||
}
|
}
|
||||||
c._xsrf_token = token
|
c._xsrf_token = token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user