From 035133276117bd69946ff5b0cbb61d7e16333643 Mon Sep 17 00:00:00 2001 From: JalonSolov Date: Sat, 28 Dec 2024 15:40:23 -0500 Subject: [PATCH] net.http.cookie: handle value with `=` better (fix #23297) (#23300) --- vlib/net/http/cookie.v | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vlib/net/http/cookie.v b/vlib/net/http/cookie.v index aff4c75b40a0f0..42f991cfc0064a 100644 --- a/vlib/net/http/cookie.v +++ b/vlib/net/http/cookie.v @@ -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 }