@@ -71,8 +71,12 @@ using Sockets, Test
7171 ([" Set-Cookie" => " Cookie-1=v\$ 1" ], [HTTP. Cookie (" Cookie-1" , " v\$ 1" )]),
7272 ([" Set-Cookie" => " NID=99=YsDT5i3E-CXax-; expires=Wed, 23-Nov-2011 01:05:03 GMT; path=/; domain=.google.ch; HttpOnly" ],
7373 [HTTP. Cookie (" NID" , " 99=YsDT5i3E-CXax-" ; path= " /" , domain= " .google.ch" , httponly= true , expires= HTTP. Dates. DateTime (2011 , 11 , 23 , 1 , 5 , 3 , 0 ))]),
74+ ([" Set-Cookie" => " NID=99=YsDT5i3E-CXax-; expires=Wed, 23 Nov 2011 01:05:03 GMT; path=/; domain=.google.ch; HttpOnly" ],
75+ [HTTP. Cookie (" NID" , " 99=YsDT5i3E-CXax-" ; path= " /" , domain= " .google.ch" , httponly= true , expires= HTTP. Dates. DateTime (2011 , 11 , 23 , 1 , 5 , 3 , 0 ))]),
7476 ([" Set-Cookie" => " .ASPXAUTH=7E3AA; expires=Wed, 07-Mar-2012 14:25:06 GMT; path=/; HttpOnly" ],
7577 [HTTP. Cookie (" .ASPXAUTH" , " 7E3AA" ; path= " /" , expires= HTTP. Dates. DateTime (2012 , 3 , 7 , 14 , 25 , 6 , 0 ), httponly= true )]),
78+ ([" Set-Cookie" => " .ASPXAUTH=7E3AA; expires=Wed, 07 Mar 2012 14:25:06 GMT; path=/; HttpOnly" ],
79+ [HTTP. Cookie (" .ASPXAUTH" , " 7E3AA" ; path= " /" , expires= HTTP. Dates. DateTime (2012 , 3 , 7 , 14 , 25 , 6 , 0 ), httponly= true )]),
7680 ([" Set-Cookie" => " ASP.NET_SessionId=foo; path=/; HttpOnly" ],
7781 [HTTP. Cookie (" ASP.NET_SessionId" , " foo" ; path= " /" , httponly= true )]),
7882 ([" Set-Cookie" => " samesitedefault=foo; SameSite" ], [HTTP. Cookie (" samesitedefault" , " foo" ; samesite= HTTP. Cookies. SameSiteDefaultMode)]),
@@ -264,16 +268,19 @@ using Sockets, Test
264268
265269 @testset " addcookie!" begin
266270 r = HTTP. Request (" GET" , " /" )
267- c = HTTP. Cookie (" NID" , " 99=YsDT5i3E-CXax-" ; path= " /" , domain= " .google.ch" , httponly= true , expires= HTTP. Dates. DateTime (2011 , 11 , 23 , 1 , 5 , 3 , 0 ))
271+ c = HTTP. Cookie (" NID" , " 99=YsDT5i3E-CXax-" ; path= " /" , domain= " .google.ch" , httponly= true , expires= HTTP. Dates. DateTime (2011 , 11 , 23 , 1 , 5 , 3 , 0 ))
272+ c_parsed = HTTP. Cookie (" NID" , " 99=YsDT5i3E-CXax-" ; path= " /" , domain= " google.ch" , httponly= true , expires= HTTP. Dates. DateTime (2011 , 11 , 23 , 1 , 5 , 3 , 0 ))
268273 HTTP. addcookie! (r, c)
269274 @test HTTP. header (r, " Cookie" ) == " NID=99=YsDT5i3E-CXax-"
270275 HTTP. addcookie! (r, c)
271276 @test HTTP. header (r, " Cookie" ) == " NID=99=YsDT5i3E-CXax-; NID=99=YsDT5i3E-CXax-"
272277 r = HTTP. Response (200 )
273278 HTTP. addcookie! (r, c)
274279 @test HTTP. header (r, " Set-Cookie" ) == " NID=99=YsDT5i3E-CXax-; Path=/; Domain=google.ch; Expires=Wed, 23 Nov 2011 01:05:03 GMT; HttpOnly"
280+ @test [c_parsed] == HTTP. Cookies. readsetcookies ([" Set-Cookie" => HTTP. header (r, " Set-Cookie" )])
275281 HTTP. addcookie! (r, c)
276282 @test HTTP. headers (r, " Set-Cookie" ) == [" NID=99=YsDT5i3E-CXax-; Path=/; Domain=google.ch; Expires=Wed, 23 Nov 2011 01:05:03 GMT; HttpOnly" , " NID=99=YsDT5i3E-CXax-; Path=/; Domain=google.ch; Expires=Wed, 23 Nov 2011 01:05:03 GMT; HttpOnly" ]
283+ @test [c_parsed, c_parsed] == HTTP. Cookies. readsetcookies ([" Set-Cookie" ] .=> HTTP. headers (r, " Set-Cookie" ))
277284 end
278285end
279286
0 commit comments