Skip to content

Commit

Permalink
net.http.cookie: handle value with = better (fix #23297) (#23300)
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov authored Dec 28, 2024
1 parent 64b6157 commit 0351332
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions vlib/net/http/cookie.v
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,7 @@ pub fn read_cookies(h Header, filter string) []&Cookie {
if part.len == 0 {
continue
}
mut name := part
mut val := ''
if part.contains('=') {
val_parts := part.split('=')
name = val_parts[0]
val = val_parts[1]
}
mut name, mut val := part.split_once('=') or { part, '' }
if !is_cookie_name_valid(name) {
continue
}
Expand Down

0 comments on commit 0351332

Please sign in to comment.