Skip to content

Commit

Permalink
sperate test for weird cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
kbkpbot committed Dec 24, 2024
1 parent d7e98bb commit 2558c15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vlib/net/http/response_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 2558c15

Please sign in to comment.