xref: /third_party/curl/tests/data/test31 (revision 13498266)
113498266Sopenharmony_ci<testcase>
213498266Sopenharmony_ci<info>
313498266Sopenharmony_ci<keywords>
413498266Sopenharmony_ciHTTP
513498266Sopenharmony_ciHTTP GET
613498266Sopenharmony_cicookies
713498266Sopenharmony_cicookiejar
813498266Sopenharmony_ci</keywords>
913498266Sopenharmony_ci</info>
1013498266Sopenharmony_ci# Server-side
1113498266Sopenharmony_ci#
1213498266Sopenharmony_ci# The cookies set come in two versions. This is because when curl is built
1313498266Sopenharmony_ci# with Hyper, the API provides the headers already "sanitized" so we cannot
1413498266Sopenharmony_ci# compare with the exact server contents unless it too sends the data
1513498266Sopenharmony_ci# "clean".
1613498266Sopenharmony_ci
1713498266Sopenharmony_ci<reply>
1813498266Sopenharmony_ci<data>
1913498266Sopenharmony_ciHTTP/1.1 200 OK
2013498266Sopenharmony_ciDate: Tue, 09 Nov 2010 14:49:00 GMT
2113498266Sopenharmony_ciServer: test-server/fake
2213498266Sopenharmony_ciContent-Length: 4
2313498266Sopenharmony_ciContent-Type: text/html
2413498266Sopenharmony_ciFunny-head: yesyes
2513498266Sopenharmony_ciSet-Cookie: blankdomain=sure; domain=; path=/
2613498266Sopenharmony_ci%if !hyper
2713498266Sopenharmony_ciSet-Cookie: foobar=name; domain=anything.com; path=/ ; secure
2813498266Sopenharmony_ciSet-Cookie:ismatch=this  ; domain=test31.curl; path=/silly/
2913498266Sopenharmony_ciSet-Cookie: overwrite=this  ; domain=test31.curl; path=/overwrite/
3013498266Sopenharmony_ciSet-Cookie: overwrite=this2  ; domain=test31.curl; path=/overwrite
3113498266Sopenharmony_ciSet-Cookie: sec1value=secure1  ; domain=test31.curl; path=/secure1/ ; secure
3213498266Sopenharmony_ciSet-Cookie: sec2value=secure2  ; domain=test31.curl; path=/secure2/ ; secure=
3313498266Sopenharmony_ciSet-Cookie: sec3value=secure3  ; domain=test31.curl; path=/secure3/ ; secure=
3413498266Sopenharmony_ciSet-Cookie: sec4value=secure4  ; secure=; domain=test31.curl; path=/secure4/ ; 
3513498266Sopenharmony_ciSet-Cookie: sec5value=secure5  ; secure; domain=test31.curl; path=/secure5/ ; 
3613498266Sopenharmony_ciSet-Cookie: sec6value=secure6  ; secure ; domain=test31.curl; path=/secure6/ ; 
3713498266Sopenharmony_ciSet-Cookie: sec7value=secure7  ; secure   ; domain=test31.curl; path=/secure7/ ; 
3813498266Sopenharmony_ciSet-Cookie: sec8value=secure8  ; secure= ; domain=test31.curl; path=/secure8/ ; 
3913498266Sopenharmony_ciSet-Cookie: secure=very1  ; secure=; domain=test31.curl; path=/secure9/; 
4013498266Sopenharmony_ciSet-Cookie: httpo1=value1  ; domain=test31.curl; path=/p1/; httponly
4113498266Sopenharmony_ciSet-Cookie: httpo2=value2  ; domain=test31.curl; path=/p2/; httponly=
4213498266Sopenharmony_ciSet-Cookie: httpo3=value3  ; httponly; domain=test31.curl; path=/p3/;
4313498266Sopenharmony_ciSet-Cookie: httpo4=value4  ; httponly=; domain=test31.curl; path=/p4/; 
4413498266Sopenharmony_ciSet-Cookie: httponly=myvalue1  ; domain=test31.curl; path=/p4/; httponly
4513498266Sopenharmony_ciSet-Cookie: httpandsec=myvalue2  ; domain=test31.curl; path=/p4/; httponly; secure
4613498266Sopenharmony_ciSet-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure
4713498266Sopenharmony_ciSet-Cookie: httpandsec3=myvalue4  ; domain=test31.curl; path=/p4/; httponly; secure=
4813498266Sopenharmony_ciSet-Cookie: httpandsec4=myvalue5  ; domain=test31.curl; path=/p4/; httponly=; secure=
4913498266Sopenharmony_ciSet-Cookie: httpandsec5=myvalue6  ; domain=test31.curl; path=/p4/; secure; httponly=
5013498266Sopenharmony_ciSet-Cookie: httpandsec6=myvalue7  ; domain=test31.curl; path=/p4/; secure=; httponly=
5113498266Sopenharmony_ciSet-Cookie: httpandsec7=myvalue8  ; domain=test31.curl; path=/p4/; secure; httponly
5213498266Sopenharmony_ciSet-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly
5313498266Sopenharmony_ciSet-Cookie: partmatch=present; domain=test31.curl ; path=/;
5413498266Sopenharmony_ciSet-Cookie:eat=this; domain=moo.foo.moo;
5513498266Sopenharmony_ciSet-Cookie: eat=this-too; domain=.foo.moo;
5613498266Sopenharmony_ciSet-Cookie: nodomainnovalue
5713498266Sopenharmony_ci%if large-time
5813498266Sopenharmony_ciSet-Cookie:   nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
5913498266Sopenharmony_ciSet-Cookie: novalue; domain=reallysilly
6013498266Sopenharmony_ciSet-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
6113498266Sopenharmony_ciSet-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
6213498266Sopenharmony_ci%else
6313498266Sopenharmony_ciSet-Cookie:   nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
6413498266Sopenharmony_ciSet-Cookie: novalue; domain=reallysilly
6513498266Sopenharmony_ciSet-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
6613498266Sopenharmony_ciSet-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
6713498266Sopenharmony_ci%endif
6813498266Sopenharmony_ciSet-Cookie: magic=yessir; path=/silly/; HttpOnly
6913498266Sopenharmony_ciSet-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
7013498266Sopenharmony_ciSet-Cookie: partialip=nono; domain=.0.0.1;
7113498266Sopenharmony_ciSet-Cookie: withspaces=  yes  within and around    ;
7213498266Sopenharmony_ciSet-Cookie: withspaces2 =before equals;
7313498266Sopenharmony_ciSet-Cookie: prespace=  yes before;
7413498266Sopenharmony_ciSet-Cookie: securewithspace=after    ; secure =
7513498266Sopenharmony_ci%else
7613498266Sopenharmony_ciSet-Cookie: foobar=name; domain=anything.com; path=/ ; secure
7713498266Sopenharmony_ciSet-Cookie: ismatch=this  ; domain=test31.curl; path=/silly/
7813498266Sopenharmony_ciSet-Cookie: overwrite=this  ; domain=test31.curl; path=/overwrite/
7913498266Sopenharmony_ciSet-Cookie: overwrite=this2  ; domain=test31.curl; path=/overwrite
8013498266Sopenharmony_ciSet-Cookie: sec1value=secure1  ; domain=test31.curl; path=/secure1/ ; secure
8113498266Sopenharmony_ciSet-Cookie: sec2value=secure2  ; domain=test31.curl; path=/secure2/ ; secure=
8213498266Sopenharmony_ciSet-Cookie: sec3value=secure3  ; domain=test31.curl; path=/secure3/ ; secure=
8313498266Sopenharmony_ciSet-Cookie: sec4value=secure4  ; secure=; domain=test31.curl; path=/secure4/ ;
8413498266Sopenharmony_ciSet-Cookie: sec5value=secure5  ; secure; domain=test31.curl; path=/secure5/ ;
8513498266Sopenharmony_ciSet-Cookie: sec6value=secure6  ; secure ; domain=test31.curl; path=/secure6/ ;
8613498266Sopenharmony_ciSet-Cookie: sec7value=secure7  ; secure   ; domain=test31.curl; path=/secure7/ ;
8713498266Sopenharmony_ciSet-Cookie: sec8value=secure8  ; secure= ; domain=test31.curl; path=/secure8/ ;
8813498266Sopenharmony_ciSet-Cookie: secure=very1  ; secure=; domain=test31.curl; path=/secure9/;
8913498266Sopenharmony_ciSet-Cookie: httpo1=value1  ; domain=test31.curl; path=/p1/; httponly
9013498266Sopenharmony_ciSet-Cookie: httpo2=value2  ; domain=test31.curl; path=/p2/; httponly=
9113498266Sopenharmony_ciSet-Cookie: httpo3=value3  ; httponly; domain=test31.curl; path=/p3/;
9213498266Sopenharmony_ciSet-Cookie: httpo4=value4  ; httponly=; domain=test31.curl; path=/p4/;
9313498266Sopenharmony_ciSet-Cookie: httponly=myvalue1  ; domain=test31.curl; path=/p4/; httponly
9413498266Sopenharmony_ciSet-Cookie: httpandsec=myvalue2  ; domain=test31.curl; path=/p4/; httponly; secure
9513498266Sopenharmony_ciSet-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure
9613498266Sopenharmony_ciSet-Cookie: httpandsec3=myvalue4  ; domain=test31.curl; path=/p4/; httponly; secure=
9713498266Sopenharmony_ciSet-Cookie: httpandsec4=myvalue5  ; domain=test31.curl; path=/p4/; httponly=; secure=
9813498266Sopenharmony_ciSet-Cookie: httpandsec5=myvalue6  ; domain=test31.curl; path=/p4/; secure; httponly=
9913498266Sopenharmony_ciSet-Cookie: httpandsec6=myvalue7  ; domain=test31.curl; path=/p4/; secure=; httponly=
10013498266Sopenharmony_ciSet-Cookie: httpandsec7=myvalue8  ; domain=test31.curl; path=/p4/; secure; httponly
10113498266Sopenharmony_ciSet-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly
10213498266Sopenharmony_ciSet-Cookie: partmatch=present; domain=test31.curl ; path=/;
10313498266Sopenharmony_ciSet-Cookie: eat=this; domain=moo.foo.moo;
10413498266Sopenharmony_ciSet-Cookie: eat=this-too; domain=.foo.moo;
10513498266Sopenharmony_ciSet-Cookie: nodomainnovalue
10613498266Sopenharmony_ci%if large-time
10713498266Sopenharmony_ciSet-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
10813498266Sopenharmony_ciSet-Cookie: novalue; domain=reallysilly
10913498266Sopenharmony_ciSet-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
11013498266Sopenharmony_ciSet-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
11113498266Sopenharmony_ci%else
11213498266Sopenharmony_ciSet-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
11313498266Sopenharmony_ciSet-Cookie: novalue; domain=reallysilly
11413498266Sopenharmony_ciSet-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
11513498266Sopenharmony_ciSet-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
11613498266Sopenharmony_ci%endif
11713498266Sopenharmony_ciSet-Cookie: magic=yessir; path=/silly/; HttpOnly
11813498266Sopenharmony_ciSet-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
11913498266Sopenharmony_ciSet-Cookie: partialip=nono; domain=.0.0.1;
12013498266Sopenharmony_ciSet-Cookie: withspaces=  yes  within and around    ;
12113498266Sopenharmony_ciSet-Cookie: withspaces2 =before equals;
12213498266Sopenharmony_ciSet-Cookie: prespace=  yes before;
12313498266Sopenharmony_ciSet-Cookie: securewithspace=after    ; secure =
12413498266Sopenharmony_ci%endif
12513498266Sopenharmony_ci
12613498266Sopenharmony_ciboo
12713498266Sopenharmony_ci</data>
12813498266Sopenharmony_ci</reply>
12913498266Sopenharmony_ci
13013498266Sopenharmony_ci# Client-side
13113498266Sopenharmony_ci<client>
13213498266Sopenharmony_ci<server>
13313498266Sopenharmony_cihttp
13413498266Sopenharmony_ci</server>
13513498266Sopenharmony_ci<name>
13613498266Sopenharmony_ciHTTP with weirdly formatted cookies and cookiejar storage
13713498266Sopenharmony_ci</name>
13813498266Sopenharmony_ci# Explicitly set the time zone to a known good one, in case the user is
13913498266Sopenharmony_ci# using one of the 'right' zones that take into account leap seconds
14013498266Sopenharmony_ci# which causes the cookie expiry times to be different.
14113498266Sopenharmony_ci<setenv>
14213498266Sopenharmony_ciTZ=GMT
14313498266Sopenharmony_ci</setenv>
14413498266Sopenharmony_ci<command>
14513498266Sopenharmony_cihttp://test31.curl:%HTTPPORT/we/want/%TESTNUMBER -b none -c %LOGDIR/jar%TESTNUMBER.txt --resolve test31.curl:%HTTPPORT:127.0.0.1
14613498266Sopenharmony_ci</command>
14713498266Sopenharmony_ci<precheck>
14813498266Sopenharmony_ciperl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
14913498266Sopenharmony_ci</precheck>
15013498266Sopenharmony_ci<features>
15113498266Sopenharmony_cicookies
15213498266Sopenharmony_ci</features>
15313498266Sopenharmony_ci</client>
15413498266Sopenharmony_ci
15513498266Sopenharmony_ci# Verify data after the test has been "shot"
15613498266Sopenharmony_ci<verify>
15713498266Sopenharmony_ci<protocol>
15813498266Sopenharmony_ciGET /we/want/%TESTNUMBER HTTP/1.1
15913498266Sopenharmony_ciHost: test31.curl:%HTTPPORT
16013498266Sopenharmony_ciUser-Agent: curl/%VERSION
16113498266Sopenharmony_ciAccept: */*
16213498266Sopenharmony_ci
16313498266Sopenharmony_ci</protocol>
16413498266Sopenharmony_ci<file name="%LOGDIR/jar%TESTNUMBER.txt" mode="text">
16513498266Sopenharmony_ci# Netscape HTTP Cookie File
16613498266Sopenharmony_ci# https://curl.se/docs/http-cookies.html
16713498266Sopenharmony_ci# This file was generated by libcurl! Edit at your own risk.
16813498266Sopenharmony_ci
16913498266Sopenharmony_citest31.curl	FALSE	/we/want/	FALSE	0	prespace	yes before
17013498266Sopenharmony_citest31.curl	FALSE	/we/want/	FALSE	0	withspaces2	before equals
17113498266Sopenharmony_citest31.curl	FALSE	/we/want/	FALSE	0	withspaces	yes  within and around
17213498266Sopenharmony_ci.test31.curl	TRUE	/we/want/	FALSE	0	blexp	yesyes
17313498266Sopenharmony_ci#HttpOnly_test31.curl	FALSE	/silly/	FALSE	0	magic	yessir
17413498266Sopenharmony_ci%if large-time
17513498266Sopenharmony_citest31.curl	FALSE	/we/want/	FALSE	17517902187	nodomain	value
17613498266Sopenharmony_ci%else
17713498266Sopenharmony_citest31.curl	FALSE	/we/want/	FALSE	2118138987	nodomain	value
17813498266Sopenharmony_ci%endif
17913498266Sopenharmony_ci.test31.curl	TRUE	/	FALSE	0	partmatch	present
18013498266Sopenharmony_ci#HttpOnly_.test31.curl	TRUE	/p4/	FALSE	0	httponly	myvalue1
18113498266Sopenharmony_ci#HttpOnly_.test31.curl	TRUE	/p4/	FALSE	0	httpo4	value4
18213498266Sopenharmony_ci#HttpOnly_.test31.curl	TRUE	/p3/	FALSE	0	httpo3	value3
18313498266Sopenharmony_ci#HttpOnly_.test31.curl	TRUE	/p2/	FALSE	0	httpo2	value2
18413498266Sopenharmony_ci#HttpOnly_.test31.curl	TRUE	/p1/	FALSE	0	httpo1	value1
18513498266Sopenharmony_ci.test31.curl	TRUE	/overwrite	FALSE	0	overwrite	this2
18613498266Sopenharmony_ci.test31.curl	TRUE	/silly/	FALSE	0	ismatch	this
18713498266Sopenharmony_citest31.curl	FALSE	/	FALSE	0	blankdomain	sure
18813498266Sopenharmony_ci</file>
18913498266Sopenharmony_ci</verify>
19013498266Sopenharmony_ci</testcase>
191