xref: /curl/tests/data/test31 (revision 9919149a)
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6cookies
7cookiejar
8</keywords>
9</info>
10# Server-side
11#
12# The cookies set come in two versions. This is because when curl is built
13# with Hyper, the API provides the headers already "sanitized" so we cannot
14# compare with the exact server contents unless it too sends the data
15# "clean".
16
17<reply>
18<data>
19HTTP/1.1 200 OK
20Date: Tue, 09 Nov 2010 14:49:00 GMT
21Server: test-server/fake
22Content-Length: 4
23Content-Type: text/html
24Funny-head: yesyes
25Set-Cookie: blankdomain=sure; domain=; path=/
26%if !hyper
27Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
28Set-Cookie:ismatch=this  ; domain=test31.curl; path=/silly/
29Set-Cookie:ISMATCH=this  ; domain=test31.curl; path=/silly/
30Set-Cookie: overwrite=this  ; domain=test31.curl; path=/overwrite/
31Set-Cookie: overwrite=this2  ; domain=test31.curl; path=/overwrite
32Set-Cookie: sec1value=secure1  ; domain=test31.curl; path=/secure1/ ; secure
33Set-Cookie: sec2value=secure2  ; domain=test31.curl; path=/secure2/ ; secure=
34Set-Cookie: sec3value=secure3  ; domain=test31.curl; path=/secure3/ ; secure=
35Set-Cookie: sec4value=secure4  ; secure=; domain=test31.curl; path=/secure4/ ;
36Set-Cookie: sec5value=secure5  ; secure; domain=test31.curl; path=/secure5/ ;
37Set-Cookie: sec6value=secure6  ; secure ; domain=test31.curl; path=/secure6/ ;
38Set-Cookie: sec7value=secure7  ; secure   ; domain=test31.curl; path=/secure7/ ;
39Set-Cookie: sec8value=secure8  ; secure= ; domain=test31.curl; path=/secure8/ ;
40Set-Cookie: secure=very1  ; secure=; domain=test31.curl; path=/secure9/;
41Set-Cookie: httpo1=value1  ; domain=test31.curl; path=/p1/; httponly
42Set-Cookie: httpo2=value2  ; domain=test31.curl; path=/p2/; httponly=
43Set-Cookie: httpo3=value3  ; httponly; domain=test31.curl; path=/p3/;
44Set-Cookie: httpo4=value4  ; httponly=; domain=test31.curl; path=/p4/;
45Set-Cookie: httponly=myvalue1  ; domain=test31.curl; path=/p4/; httponly
46Set-Cookie: httpandsec=myvalue2  ; domain=test31.curl; path=/p4/; httponly; secure
47Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure
48Set-Cookie: httpandsec3=myvalue4  ; domain=test31.curl; path=/p4/; httponly; secure=
49Set-Cookie: httpandsec4=myvalue5  ; domain=test31.curl; path=/p4/; httponly=; secure=
50Set-Cookie: httpandsec5=myvalue6  ; domain=test31.curl; path=/p4/; secure; httponly=
51Set-Cookie: httpandsec6=myvalue7  ; domain=test31.curl; path=/p4/; secure=; httponly=
52Set-Cookie: httpandsec7=myvalue8  ; domain=test31.curl; path=/p4/; secure; httponly
53Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly
54Set-Cookie: partmatch=present; domain=test31.curl ; path=/;
55Set-Cookie:eat=this; domain=moo.foo.moo;
56Set-Cookie: eat=this-too; domain=.foo.moo;
57Set-Cookie: nodomainnovalue
58%if large-time
59Set-Cookie:   nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
60Set-Cookie: novalue; domain=reallysilly
61Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
62Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
63%else
64Set-Cookie:   nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
65Set-Cookie: novalue; domain=reallysilly
66Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
67Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
68%endif
69Set-Cookie: magic=yessir; path=/silly/; HttpOnly
70Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
71Set-Cookie: partialip=nono; domain=.0.0.1;
72Set-Cookie: withspaces=  yes  within and around    ;
73Set-Cookie: withspaces2 =before equals;
74Set-Cookie: prespace=  yes before;
75Set-Cookie: securewithspace=after    ; secure =
76%else
77Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
78Set-Cookie: ismatch=this  ; domain=test31.curl; path=/silly/
79Set-Cookie:ISMATCH=this  ; domain=test31.curl; path=/silly/
80Set-Cookie: overwrite=this  ; domain=test31.curl; path=/overwrite/
81Set-Cookie: overwrite=this2  ; domain=test31.curl; path=/overwrite
82Set-Cookie: sec1value=secure1  ; domain=test31.curl; path=/secure1/ ; secure
83Set-Cookie: sec2value=secure2  ; domain=test31.curl; path=/secure2/ ; secure=
84Set-Cookie: sec3value=secure3  ; domain=test31.curl; path=/secure3/ ; secure=
85Set-Cookie: sec4value=secure4  ; secure=; domain=test31.curl; path=/secure4/ ;
86Set-Cookie: sec5value=secure5  ; secure; domain=test31.curl; path=/secure5/ ;
87Set-Cookie: sec6value=secure6  ; secure ; domain=test31.curl; path=/secure6/ ;
88Set-Cookie: sec7value=secure7  ; secure   ; domain=test31.curl; path=/secure7/ ;
89Set-Cookie: sec8value=secure8  ; secure= ; domain=test31.curl; path=/secure8/ ;
90Set-Cookie: secure=very1  ; secure=; domain=test31.curl; path=/secure9/;
91Set-Cookie: httpo1=value1  ; domain=test31.curl; path=/p1/; httponly
92Set-Cookie: httpo2=value2  ; domain=test31.curl; path=/p2/; httponly=
93Set-Cookie: httpo3=value3  ; httponly; domain=test31.curl; path=/p3/;
94Set-Cookie: httpo4=value4  ; httponly=; domain=test31.curl; path=/p4/;
95Set-Cookie: httponly=myvalue1  ; domain=test31.curl; path=/p4/; httponly
96Set-Cookie: httpandsec=myvalue2  ; domain=test31.curl; path=/p4/; httponly; secure
97Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure
98Set-Cookie: httpandsec3=myvalue4  ; domain=test31.curl; path=/p4/; httponly; secure=
99Set-Cookie: httpandsec4=myvalue5  ; domain=test31.curl; path=/p4/; httponly=; secure=
100Set-Cookie: httpandsec5=myvalue6  ; domain=test31.curl; path=/p4/; secure; httponly=
101Set-Cookie: httpandsec6=myvalue7  ; domain=test31.curl; path=/p4/; secure=; httponly=
102Set-Cookie: httpandsec7=myvalue8  ; domain=test31.curl; path=/p4/; secure; httponly
103Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly
104Set-Cookie: partmatch=present; domain=test31.curl ; path=/;
105Set-Cookie: eat=this; domain=moo.foo.moo;
106Set-Cookie: eat=this-too; domain=.foo.moo;
107Set-Cookie: nodomainnovalue
108%if large-time
109Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
110Set-Cookie: novalue; domain=reallysilly
111Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
112Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
113%else
114Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
115Set-Cookie: novalue; domain=reallysilly
116Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
117Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
118%endif
119Set-Cookie: magic=yessir; path=/silly/; HttpOnly
120Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
121Set-Cookie: partialip=nono; domain=.0.0.1;
122Set-Cookie: withspaces=  yes  within and around    ;
123Set-Cookie: withspaces2 =before equals;
124Set-Cookie: prespace=  yes before;
125Set-Cookie: securewithspace=after    ; secure =
126%endif
127
128boo
129</data>
130</reply>
131
132# Client-side
133<client>
134<server>
135http
136</server>
137<name>
138HTTP with weirdly formatted cookies and cookiejar storage
139</name>
140# Explicitly set the time zone to a known good one, in case the user is
141# using one of the 'right' zones that take into account leap seconds
142# which causes the cookie expiry times to be different.
143<setenv>
144TZ=GMT
145</setenv>
146<command>
147http://test31.curl:%HTTPPORT/we/want/%TESTNUMBER -b none -c %LOGDIR/jar%TESTNUMBER.txt --resolve test31.curl:%HTTPPORT:127.0.0.1
148</command>
149<features>
150cookies
151local-http
152</features>
153</client>
154
155# Verify data after the test has been "shot"
156<verify>
157<protocol>
158GET /we/want/%TESTNUMBER HTTP/1.1
159Host: test31.curl:%HTTPPORT
160User-Agent: curl/%VERSION
161Accept: */*
162
163</protocol>
164<file name="%LOGDIR/jar%TESTNUMBER.txt" mode="text">
165# Netscape HTTP Cookie File
166# https://curl.se/docs/http-cookies.html
167# This file was generated by libcurl! Edit at your own risk.
168
169test31.curl	FALSE	/we/want/	FALSE	0	prespace	yes before
170test31.curl	FALSE	/we/want/	FALSE	0	withspaces2	before equals
171test31.curl	FALSE	/we/want/	FALSE	0	withspaces	yes  within and around
172.test31.curl	TRUE	/we/want/	FALSE	0	blexp	yesyes
173#HttpOnly_test31.curl	FALSE	/silly/	FALSE	0	magic	yessir
174%if large-time
175test31.curl	FALSE	/we/want/	FALSE	17517902187	nodomain	value
176%else
177test31.curl	FALSE	/we/want/	FALSE	2118138987	nodomain	value
178%endif
179.test31.curl	TRUE	/	FALSE	0	partmatch	present
180#HttpOnly_.test31.curl	TRUE	/p4/	FALSE	0	httponly	myvalue1
181#HttpOnly_.test31.curl	TRUE	/p4/	FALSE	0	httpo4	value4
182#HttpOnly_.test31.curl	TRUE	/p3/	FALSE	0	httpo3	value3
183#HttpOnly_.test31.curl	TRUE	/p2/	FALSE	0	httpo2	value2
184#HttpOnly_.test31.curl	TRUE	/p1/	FALSE	0	httpo1	value1
185.test31.curl	TRUE	/overwrite	FALSE	0	overwrite	this2
186.test31.curl	TRUE	/silly/	FALSE	0	ISMATCH	this
187.test31.curl	TRUE	/silly/	FALSE	0	ismatch	this
188test31.curl	FALSE	/	FALSE	0	blankdomain	sure
189</file>
190</verify>
191</testcase>
192