diff options
author | Hank Shen <swh@admpub.com> | 2023-12-05 20:38:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 20:38:42 +0300 |
commit | f14b1ebae207764cbbbfe6ca658aaf4873522948 (patch) | |
tree | 677b8334304a2ed41f51ee00994e9a13b9269bf9 | |
parent | 8ec3d1ab52c633fbec232b62d021679b84730d18 (diff) |
Update securecookie.gov1.2.1
-rw-r--r-- | securecookie.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/securecookie.go b/securecookie.go index ab708a3..97f0847 100644 --- a/securecookie.go +++ b/securecookie.go @@ -118,6 +118,8 @@ type Codec interface { Decode(name, value string, dst interface{}, maxAge ...int) error } +var DefaultMaxLength = 1024 * 1024 // 1M + // New returns a new SecureCookie. // // hashKey is required, used to authenticate values using HMAC. Create it using @@ -138,7 +140,7 @@ func New(hashKey, blockKey []byte) *SecureCookie { blockKey: blockKey, hashFunc: sha256.New, maxAge: 86400 * 30, - maxLength: 4096, + maxLength: DefaultMaxLength, sz: GobEncoder{}, } if len(hashKey) == 0 { |