aboutsummaryrefslogtreecommitdiff
path: root/securecookie.go
diff options
context:
space:
mode:
authorWesley Bitter <github@wessie.info>2018-05-18 18:25:24 +0300
committerMatt Silverlock <matt@eatsleeprepeat.net>2018-05-18 18:25:24 +0300
commitb009e17e9cb1a3b7b447cf9dc0110fcaebcc1b6b (patch)
tree5ce082fb1f264db2981b218b17493c0ebe59b23c /securecookie.go
parente59506cc896acb7f7bf732d4fdf5e25f7ccd8983 (diff)
[bugfix] check for an empty hashKey (#52)
this scenario might occur when converting from an empty string to byte slice, such as when reading from a configuration file.
Diffstat (limited to 'securecookie.go')
-rw-r--r--securecookie.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/securecookie.go b/securecookie.go
index cd4e097..61af390 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -141,7 +141,7 @@ func New(hashKey, blockKey []byte) *SecureCookie {
maxLength: 4096,
sz: GobEncoder{},
}
- if hashKey == nil {
+ if len(hashKey) == 0 {
s.err = errHashKeyNotSet
}
if blockKey != nil {