xref: /curl/tests/data/test8 (revision 31a29fc6)
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6cookies
7</keywords>
8</info>
9# Server-side
10<reply>
11<data>
12HTTP/1.1 200 OK swsclose
13Date: Tue, 09 Nov 2010 14:49:00 GMT
14Server: test-server/fake
15
16</data>
17</reply>
18
19# Client-side
20<client>
21<server>
22http
23</server>
24<name>
25HTTP with cookie parsing from header file
26</name>
27<command>
28http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b %LOGDIR/heads%TESTNUMBER.txt
29</command>
30
31# We create this file before the command is invoked!
32<file name="%LOGDIR/heads%TESTNUMBER.txt">
33HTTP/1.1 200 OK
34Date: Tue, 09 Nov 2010 14:49:00 GMT
35Server: test-server/fake
36Content-Type: text/html
37Funny-head: yesyes
38Set-Cookie: foobar=name; domain=%HOSTIP; path=/;
39Set-Cookie: mismatch=this; domain=%HOSTIP; path="/silly/";
40Set-Cookie: partmatch=present; domain=.0.0.1; path=/w;
41Set-Cookie: duplicate=test; domain=.0.0.1; domain=.0.0.1; path=/donkey;
42Set-Cookie: cookie=yes; path=/we;
43Set-Cookie: cookie=perhaps; path=/we/want;
44Set-Cookie: name with space=is weird but; path=/we/want;
45Set-Cookie: trailingspace    = removed; path=/we/want;
46Set-Cookie: nocookie=yes; path=/WE;
47Set-Cookie: blexp=yesyes; domain=%HOSTIP; domain=%HOSTIP; expiry=totally bad;
48Set-Cookie: partialip=nono; domain=.0.0.1;
49Set-Cookie: cookie1=%hex[%01-junk]hex%
50Set-Cookie: cookie2=%hex[%02-junk]hex%
51Set-Cookie: cookie3=%hex[%03-junk]hex%
52Set-Cookie: cookie4=%hex[%04-junk]hex%
53Set-Cookie: cookie5=%hex[%05-junk]hex%
54Set-Cookie: cookie6=%hex[%06-junk]hex%
55Set-Cookie: cookie7=%hex[%07-junk]hex%
56Set-Cookie: cookie8=%hex[%08-junk]hex%
57Set-Cookie: cookie9=%hex[junk--%09]hex%
58Set-Cookie: cookie11=%hex[%0b-junk]hex%
59Set-Cookie: cookie12=%hex[%0c-junk]hex%
60Set-Cookie: cookie14=%hex[%0e-junk]hex%
61Set-Cookie: cookie15=%hex[%0f-junk]hex%
62Set-Cookie: cookie16=%hex[%10-junk]hex%
63Set-Cookie: cookie17=%hex[%11-junk]hex%
64Set-Cookie: cookie18=%hex[%12-junk]hex%
65Set-Cookie: cookie19=%hex[%13-junk]hex%
66Set-Cookie: cookie20=%hex[%14-junk]hex%
67Set-Cookie: cookie21=%hex[%15-junk]hex%
68Set-Cookie: cookie22=%hex[%16-junk]hex%
69Set-Cookie: cookie23=%hex[%17-junk]hex%
70Set-Cookie: cookie24=%hex[%18-junk]hex%
71Set-Cookie: cookie25=%hex[%19-junk]hex%
72Set-Cookie: cookie26=%hex[%1a-junk]hex%
73Set-Cookie: cookie27=%hex[%1b-junk]hex%
74Set-Cookie: cookie28=%hex[%1c-junk]hex%
75Set-Cookie: cookie29=%hex[%1d-junk]hex%
76Set-Cookie: cookie30=%hex[%1e-junk]hex%
77Set-Cookie: cookie31=%hex[%1f-junk]hex%
78Set-Cookie: cookie31=%hex[%7f-junk]hex%
79
80</file>
81<precheck>
82%PERL -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}'
83</precheck>
84<features>
85cookies
86</features>
87</client>
88
89# Verify data after the test has been "shot"
90<verify>
91<protocol>
92GET /we/want/%TESTNUMBER HTTP/1.1
93Host: %HOSTIP:%HTTPPORT
94User-Agent: curl/%VERSION
95Accept: */*
96Cookie: name with space=is weird but; trailingspace=removed; cookie=perhaps; cookie=yes; foobar=name; blexp=yesyes; cookie9=junk--
97
98</protocol>
99</verify>
100</testcase>
101