mirror of
https://github.com/rancher/norman.git
synced 2025-09-05 09:10:31 +00:00
updated cookie token size
This commit is contained in:
@@ -52,7 +52,8 @@ func CheckCSRF(apiContext *types.APIContext) error {
|
|||||||
|
|
||||||
cookie, err := apiContext.Request.Cookie(csrfCookie)
|
cookie, err := apiContext.Request.Cookie(csrfCookie)
|
||||||
if err == http.ErrNoCookie {
|
if err == http.ErrNoCookie {
|
||||||
bytes := make([]byte, 5)
|
// 16 bytes = 32 Hex Char = 128 bit entropy
|
||||||
|
bytes := make([]byte, 16)
|
||||||
_, err := rand.Read(bytes)
|
_, err := rand.Read(bytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return httperror.WrapAPIError(err, httperror.ServerError, "Failed in CSRF processing")
|
return httperror.WrapAPIError(err, httperror.ServerError, "Failed in CSRF processing")
|
||||||
|
Reference in New Issue
Block a user