Imported Upstream version 7.40.0
[platform/upstream/curl.git] / tests / data / test1081
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 redirect_url
7 followlocation
8 --write-out
9 </keywords>
10 </info>
11
12 # Server-side
13 <reply>
14 <data nocheck="yes">
15 HTTP/1.1 301 This is a weirdo text message swsclose\r
16 Location: data/10810099.txt?coolsite=yes\r
17 Content-Length: 62\r
18 Connection: close\r
19 \r
20 This server reply is for testing a simple Location: following
21 </data>
22 <data2 nocheck="yes">
23 HTTP/1.1 200 Followed here fine swsclose\r
24 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
25 Server: test-server/fake\r
26 Content-Length: 41\r
27 \r
28 This second URL does not have a location
29 </data2>
30 </reply>
31
32 # Client-side
33 <client>
34 <server>
35 http
36 </server>
37  <name>
38 HTTP no Location: on second URL 'redirect_url' check
39  </name>
40  <command>
41 http://%HOSTIP:%HTTPPORT/we/want/our/1081 http://%HOSTIP:%HTTPPORT/we/want/our/10810002 -w '%{redirect_url}\n'
42 </command>
43 </client>
44
45 # Verify data after the test has been "shot"
46 <verify>
47 <strip>
48 ^User-Agent:.*
49 </strip>
50 <protocol>
51 GET /we/want/our/1081 HTTP/1.1\r
52 Host: %HOSTIP:%HTTPPORT\r
53 Accept: */*\r
54 \r
55 GET /we/want/our/10810002 HTTP/1.1\r
56 Host: %HOSTIP:%HTTPPORT\r
57 Accept: */*\r
58 \r
59 </protocol>
60 <stdout>
61 HTTP/1.1 301 This is a weirdo text message swsclose\r
62 Location: data/10810099.txt?coolsite=yes\r
63 Content-Length: 62\r
64 Connection: close\r
65 \r
66 This server reply is for testing a simple Location: following
67 http://%HOSTIP:%HTTPPORT/we/want/our/data/10810099.txt?coolsite=yes
68 HTTP/1.1 200 Followed here fine swsclose\r
69 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
70 Server: test-server/fake\r
71 Content-Length: 41\r
72 \r
73 This second URL does not have a location
74
75 </stdout>
76 </verify>
77 </testcase>