beego: enhance the XSRFKEY from 15 to 32 #620
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -452,7 +452,7 @@ func (c *Controller) XsrfToken() string { | ... | @@ -452,7 +452,7 @@ func (c *Controller) XsrfToken() string { |
| 452 | } else { | 452 | } else { |
| 453 | expire = int64(XSRFExpire) | 453 | expire = int64(XSRFExpire) |
| 454 | } | 454 | } |
| 455 | token = string(utils.RandomCreateBytes(15)) | 455 | token = string(utils.RandomCreateBytes(32)) |
| 456 | c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire) | 456 | c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire) |
| 457 | } | 457 | } |
| 458 | c._xsrf_token = token | 458 | c._xsrf_token = token | ... | ... |
-
Please register or sign in to post a comment