update
This commit is contained in:
parent
a9590b4584
commit
70411ec97c
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue