From 2558c154b75326923c6c85a2c7b98299a942541a Mon Sep 17 00:00:00 2001 From: kbkpbot Date: Tue, 24 Dec 2024 23:36:05 +0800 Subject: [PATCH] sperate test for weird cookie --- vlib/net/http/response_test.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/net/http/response_test.v b/vlib/net/http/response_test.v index cb04af9c62a04b..b29e820a4cfccc 100644 --- a/vlib/net/http/response_test.v +++ b/vlib/net/http/response_test.v @@ -57,9 +57,11 @@ fn test_parse_response_with_cookies() { assert x.body == 'Foo' response_cookie := x.cookies() assert response_cookie[0].str().contains(cookie) +} +fn test_parse_response_with_weird_cookie() { // weird cookies test - content_weird := 'HTTP/1.1 200 OK\r\nSet-Cookie: a=b; ; =; aa=; =bb\r\nContent-Length: 3\r\n\r\nFoo' + content_weird := 'HTTP/1.1 200 OK\r\nSet-Cookie: a=b; ; =; aa=; =bb; cc\r\nContent-Length: 3\r\n\r\nFoo' mut xx := parse_response(content_weird)! weird_cookie := xx.cookies() assert weird_cookie[0].str() == 'a=b'