]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test420: verify expiring cookies
authorDaniel Stenberg <daniel@haxx.se>
Sun, 5 Mar 2023 23:19:35 +0000 (00:19 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 6 Mar 2023 14:52:00 +0000 (15:52 +0100)
Cookies that are loaded fine from a jar but then are expired in headers.

tests/data/Makefile.inc
tests/data/test420 [new file with mode: 0644]

index 57315e3763adc8e94763288dcc0faaf2c2d9bee0..c4c6ddcadce4e999a33053a76ba866e1c9b866ac 100644 (file)
@@ -68,7 +68,7 @@ test380 test381 test383 test384 test385 test386 test387 test388 test389 \
 test390 test391 test392 test393 test394 test395 test396 test397 test398 \
 test399 test400 test401 test402 test403 test404 test405 test406 test407 \
 test408 test409 test410 test411 test412 test413 test414 test415 test416 \
-test417 test418 test419 \
+test417 test418 test419 test420 \
 \
 test430 test431 test432 test433 test434 test435 test436 \
 \
diff --git a/tests/data/test420 b/tests/data/test420
new file mode 100644 (file)
index 0000000..f89cc71
--- /dev/null
@@ -0,0 +1,71 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data crlf="yes">
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Accept-Ranges: bytes
+Content-Length: 6
+Content-Type: text/html
+Set-Cookie: mycookie=; Max-Age=-1; Expires=Thu, 01 Jan 1970 00:00:00 GMT
+Set-Cookie: mycookie3=; Path=/func_test; Max-Age=-1; Expires=Thu, 01 Jan 1970 00:00:00 GMT
+Set-Cookie: mycookie4=; Path=/func_test; Max-Age=-1; Expires=Thu, 01 Jan 1970 00:00:
+Set-Cookie: mycookie5=; Path=/func_test; Max-Age=-1; Expires=Thu, 01 Jan 1970 00:00:00 GMT
+Set-Cookie: mycookie6=; Path=/func_test; Max-Age=-1; Expires=Thu, 01 Jan 1970 00:00:00 GMT
+Set-Cookie: mycookie1=; Path=/; Max-Age=-1; Expires=Thu, 01 Jan 1970 00:00:00 GMT
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+Setting cookies set with expried dates that were loaded from jar
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/func_test/del_cookie -b log/cookie%TESTNUMBER -c log/save%TESTNUMBER
+</command>
+<file name="log/cookie%TESTNUMBER" mode="text">
+%HOSTIP        FALSE   /func_test      FALSE   1709598616      mycookie6       991
+#HttpOnly_%HOSTIP      FALSE   /func_test      FALSE   1709598616      mycookie5       990
+#HttpOnly_%HOSTIP      FALSE   /func_test      FALSE   1709598616      mycookie4       950
+#HttpOnly_%HOSTIP      FALSE   /func_test      FALSE   1709598616      mycookie3       900
+#HttpOnly_%HOSTIP      FALSE   /func_test/     FALSE   1709598616      mycookie2       5900
+#HttpOnly_%HOSTIP      FALSE   /       FALSE   1709598616      mycookie1       4900
+#HttpOnly_%HOSTIP      FALSE   /func_test/     FALSE   0       mycookie        1200
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol crlf="yes">
+GET /func_test/del_cookie HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+Cookie: mycookie2=5900; mycookie=1200; mycookie3=900; mycookie4=950; mycookie5=990; mycookie6=991; mycookie1=4900
+
+</protocol>
+<file name="log/save%TESTNUMBER" mode="text">
+# Netscape HTTP Cookie File
+# https://curl.se/docs/http-cookies.html
+# This file was generated by libcurl! Edit at your own risk.
+
+#HttpOnly_127.0.0.1    FALSE   /func_test/     FALSE   1709598616      mycookie2       5900
+</file>
+</verify>
+</testcase>