xref: /curl/tests/data/test1025 (revision 3fd80c7b)
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6followlocation
7cookies
8</keywords>
9</info>
10
11# Server-side
12<reply>
13<data>
14HTTP/1.1 301 This is a weirdo text message
15Date: Tue, 09 Nov 2010 14:49:00 GMT
16Server: test-server/fake
17Location: ../data/%TESTNUMBER0002.txt
18Set-Cookie: firstcookie=want; path=/want/
19Content-Length: 69
20
21This server reply is for testing a Location: following with cookies
22
23</data>
24<data2>
25HTTP/1.1 301 This is a weirdo text message
26Date: Tue, 09 Nov 2010 14:49:00 GMT
27Server: test-server/fake
28Location: ../want/%TESTNUMBER0003.txt
29Set-Cookie: nextcookie=data; path=/data/
30Content-Length: 69
31
32This server reply is for testing a Location: following with cookies
33
34</data2>
35<data3>
36HTTP/1.1 200 Followed here fine
37Date: Tue, 09 Nov 2010 14:49:00 GMT
38Server: test-server/fake
39Content-Length: 52
40
41If this is received, the location following worked
42
43</data3>
44<datacheck>
45HTTP/1.1 301 This is a weirdo text message
46Date: Tue, 09 Nov 2010 14:49:00 GMT
47Server: test-server/fake
48Location: ../data/%TESTNUMBER0002.txt
49Set-Cookie: firstcookie=want; path=/want/
50Content-Length: 69
51
52HTTP/1.1 301 This is a weirdo text message
53Date: Tue, 09 Nov 2010 14:49:00 GMT
54Server: test-server/fake
55Location: ../want/%TESTNUMBER0003.txt
56Set-Cookie: nextcookie=data; path=/data/
57Content-Length: 69
58
59HTTP/1.1 200 Followed here fine
60Date: Tue, 09 Nov 2010 14:49:00 GMT
61Server: test-server/fake
62Content-Length: 52
63
64If this is received, the location following worked
65
66</datacheck>
67</reply>
68
69# Client-side
70<client>
71<server>
72http
73</server>
74<name>
75HTTP Location: following with command-line and server cookies
76</name>
77<command>
78http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L -c %LOGDIR/jar%TESTNUMBER -b forcedcookie=yes
79</command>
80<features>
81cookies
82</features>
83</client>
84
85# Verify data after the test has been "shot"
86<verify>
87<protocol>
88GET /want/%TESTNUMBER HTTP/1.1
89Host: %HOSTIP:%HTTPPORT
90User-Agent: curl/%VERSION
91Accept: */*
92Cookie: forcedcookie=yes
93
94GET /data/%TESTNUMBER0002.txt HTTP/1.1
95Host: %HOSTIP:%HTTPPORT
96User-Agent: curl/%VERSION
97Accept: */*
98Cookie: forcedcookie=yes
99
100GET /want/%TESTNUMBER0003.txt HTTP/1.1
101Host: %HOSTIP:%HTTPPORT
102User-Agent: curl/%VERSION
103Accept: */*
104Cookie: firstcookie=want; forcedcookie=yes
105
106</protocol>
107</verify>
108</testcase>
109