diff options
author | Hank Shen <swh@admpub.com> | 2023-10-09 07:45:11 +0300 |
---|---|---|
committer | Hank Shen <swh@admpub.com> | 2023-10-09 07:45:11 +0300 |
commit | 70411ec97c1d20b373d980e549d7027a20b6f834 (patch) | |
tree | 8ea4d102661800870d9f5773438f596a9485d645 /securecookie.go | |
parent | a9590b45840539390424b8bbab01079c03d59db4 (diff) |
updatev1.1.3
Diffstat (limited to 'securecookie.go')
-rw-r--r-- | securecookie.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/securecookie.go b/securecookie.go index ddd3a69..ab708a3 100644 --- a/securecookie.go +++ b/securecookie.go @@ -286,7 +286,7 @@ func (s *SecureCookie) Encode(name string, value interface{}) (string, error) { b = encode(b) // 5. Check length. if s.maxLength != 0 && len(b) > s.maxLength { - return "", fmt.Errorf("%s: %d", errEncodedValueTooLong, len(b)) + return "", fmt.Errorf("[%s] %s: %d", name, errEncodedValueTooLong, len(b)) } // Done. return string(b), nil @@ -310,7 +310,7 @@ func (s *SecureCookie) Decode(name, value string, dst interface{}, maxAges ...in } // 1. Check length. if s.maxLength != 0 && len(value) > s.maxLength { - return fmt.Errorf("%s: %d", errValueToDecodeTooLong, len(value)) + return fmt.Errorf("[%s] %s: %d", name, errValueToDecodeTooLong, len(value)) } // 2. Decode from base64. b, err := decode([]byte(value)) |