mirror of
https://github.com/rancher/norman.git
synced 2025-09-01 15:18:20 +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)
|
||||
if err == http.ErrNoCookie {
|
||||
bytes := make([]byte, 5)
|
||||
// 16 bytes = 32 Hex Char = 128 bit entropy
|
||||
bytes := make([]byte, 16)
|
||||
_, err := rand.Read(bytes)
|
||||
if err != nil {
|
||||
return httperror.WrapAPIError(err, httperror.ServerError, "Failed in CSRF processing")
|
||||
|
Reference in New Issue
Block a user