1
0
mirror of https://github.com/astaxie/beego.git synced 2024-07-01 03:44:14 +00:00

Merge pull request #2801 from nightlyone/patch-1

fix bad error code in seesion handling
This commit is contained in:
astaxie 2017-08-06 22:29:05 +08:00 committed by GitHub
commit 51c19c374a

View File

@ -149,7 +149,7 @@ func decodeCookie(block cipher.Block, hashKey, name, value string, gcmaxlifetime
// 2. Verify MAC. Value is "date|value|mac". // 2. Verify MAC. Value is "date|value|mac".
parts := bytes.SplitN(b, []byte("|"), 3) parts := bytes.SplitN(b, []byte("|"), 3)
if len(parts) != 3 { if len(parts) != 3 {
return nil, errors.New("Decode: invalid value %v") return nil, errors.New("Decode: invalid value format")
} }
b = append([]byte(name+"|"), b[:len(b)-len(parts[2])]...) b = append([]byte(name+"|"), b[:len(b)-len(parts[2])]...)