From 180ce23aba863d94c17ee0667cad1ed916f56da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 6 May 2022 14:23:33 +0200 Subject: Update cookie tests against latest WPT The http-state tests were removed and replaced with tests in HTML pages. I have devised a way to semi- automatically import them and test them. Additional fixes were made following changes in the rfc6265bis draft. --- test/handlers/cookie_set_h.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/handlers/cookie_set_h.erl') diff --git a/test/handlers/cookie_set_h.erl b/test/handlers/cookie_set_h.erl index 29ff351..93ad86d 100644 --- a/test/handlers/cookie_set_h.erl +++ b/test/handlers/cookie_set_h.erl @@ -33,4 +33,10 @@ set_cookie_list(Req=#{qs := <<"prefix">>}) -> set_cookie_list(#{qs := <<"secure_http">>}) -> [<<"secure_from_nonsecure_http=1; Secure; Path=/">>]; set_cookie_list(#{qs := <<"secure_https">>}) -> - [<<"secure_from_secure_http=1; Secure; Path=/">>]. + [<<"secure_from_secure_http=1; Secure; Path=/">>]; +set_cookie_list(Req=#{qs := <<"ttb=",_/bits>>}) -> + #{ttb := SetCookies} = cowboy_req:match_qs([ttb], Req), + case binary_to_term(SetCookies) of + List when is_list(List) -> List; + Bin -> [Bin] + end. -- cgit v1.2.3