tests: verify new header undfolder

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
This commit is contained in:
Daniel Stenberg 2025-12-11 23:28:51 +01:00
parent 67ae101666
commit f0d277cb0e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 116 additions and 3 deletions

View 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 \
\

53
tests/data/test1665 Normal file
View File

@ -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>

61
tests/data/test798 Normal file
View File

@ -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>