]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: verify new header undfolder
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Dec 2025 22:28:51 +0000 (23:28 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 13 Dec 2025 22:02:27 +0000 (23:02 +0100)
test 798 - incoming cookie header in a folded line

test 1665 - verify HTTP headers without final CRLF. Make sure all complete
headers are delivered even if the reponse is partial

tests/data/Makefile.am
tests/data/test1665 [new file with mode: 0644]
tests/data/test798 [new file with mode: 0644]

index 7faa27da354534af50cdcc2c1fc13f5463b749c4..8da9a55a719831c918a25df92bde5a6bb1814e5b 100644 (file)
@@ -112,8 +112,7 @@ test754 test755 test756 test757 test758 test759 test760 test761 test762 \
 test763 test764 test765 test766 test767 test768 test769 test770 test771 \
 test772 test773 test774 test775 test776 test777 test778 test779 test780 \
 test781 test782 test783 test784 test785 test786 test787 test788 test789 \
-test790 test791 test792 test793 test794 test795 test796 test797 \
-\
+test790 test791 test792 test793 test794 test795 test796 test797 test798 \
 test799 test800 test801 test802 test803 test804 test805 test806 test807 \
 test808 test809 test810 test811 test812 test813 test814 test815 test816 \
 test817 test818 test819 test820 test821 test822 test823 test824 test825 \
@@ -221,7 +220,7 @@ test1630 test1631 test1632 test1633 test1634 test1635 \
 \
 test1650 test1651 test1652 test1653 test1654 test1655 test1656 test1657 \
 test1658 \
-test1660 test1661 test1662 test1663 test1664 \
+test1660 test1661 test1662 test1663 test1664 test1665 \
 \
 test1670 test1671 \
 \
diff --git a/tests/data/test1665 b/tests/data/test1665
new file mode 100644 (file)
index 0000000..2408358
--- /dev/null
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: swsclose
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP with only headers and no final CRLF separator
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol crlf="headers">
+GET /%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+<errorcode>
+18
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test798 b/tests/data/test798
new file mode 100644 (file)
index 0000000..07f44fe
--- /dev/null
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+cookiejar
+</keywords>
+</info>
+# Server-side
+#
+
+<reply>
+<data crlf="headers" nocheck="yes">
+HTTP/1.1 200 OK
+Content-Length: 4
+Set-Cookie: flavor=tasty;
+ domain=localhost;
+ path=/p4/;
+ httponly;
+ secure
+
+boo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP cookies in a folded header
+</name>
+<command>
+http://localhost:%HTTPPORT/we/want/%TESTNUMBER -b none -c %LOGDIR/jar%TESTNUMBER.txt
+</command>
+<features>
+cookies
+local-http
+</features>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol crlf="headers">
+GET /we/want/%TESTNUMBER HTTP/1.1
+Host: localhost:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+<file name="%LOGDIR/jar%TESTNUMBER.txt" 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_.localhost   TRUE    /p4     TRUE    0       flavor  tasty
+</file>
+</verify>
+</testcase>