mirror of
https://github.com/alibaba/higress.git
synced 2026-07-28 23:30:29 +08:00
fix(jwt-auth): harden cookie token parsing (#4153)
Signed-off-by: EndlessSeeker <1766508902@qq.com>
This commit is contained in:
@@ -129,8 +129,8 @@ func findCookie(cookie string, key string) string {
|
||||
|
||||
for _, pair := range pairs {
|
||||
pair = strings.TrimSpace(pair)
|
||||
kv := strings.Split(pair, "=")
|
||||
if kv[0] == key {
|
||||
kv := strings.SplitN(pair, "=", 2)
|
||||
if len(kv) == 2 && kv[0] == key {
|
||||
value = kv[1]
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user