1fb13cbef5783885d348f229468cdf7b2852d25d
[platform/upstream/curl.git] / tests / data / test1087
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP proxy
6 HTTP Basic auth
7 HTTP proxy Basic auth
8 followlocation
9 --anyauth
10 </keywords>
11 </info>
12
13 #
14 # Server-side
15 <reply>
16 <data1000 nocheck="yes">
17 HTTP/1.1 401 Authorization Required\r
18 WWW-Authenticate: Basic\r
19 Content-Type: text/plain\r
20 Content-Length: 0\r
21 \r
22 </data1000>
23 <data1001 nocheck="yes">
24 HTTP/1.1 302 OK\r
25 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
26 Server: test-server/fake swsclose\r
27 Content-Type: text/plain\r
28 Funny-head: yesyes\r
29 Location: http://goto.second.host.now/10871002\r
30 Content-Length: 0\r
31 Connection: close\r
32 \r
33 </data1001>
34 <data1002 nocheck="yes">
35 HTTP/1.1 200 OK\r
36 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
37 Server: test-server/fake swsclose\r
38 Content-Type: text/plain\r
39 Funny-head: yesyes\r
40 Content-Length: 9\r
41 \r
42 contents
43 </data1002>
44
45 <datacheck>
46 HTTP/1.1 401 Authorization Required\r
47 WWW-Authenticate: Basic\r
48 Content-Type: text/plain\r
49 Content-Length: 0\r
50 \r
51 HTTP/1.1 302 OK\r
52 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
53 Server: test-server/fake swsclose\r
54 Content-Type: text/plain\r
55 Funny-head: yesyes\r
56 Location: http://goto.second.host.now/10871002\r
57 Content-Length: 0\r
58 Connection: close\r
59 \r
60 HTTP/1.1 200 OK\r
61 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
62 Server: test-server/fake swsclose\r
63 Content-Type: text/plain\r
64 Funny-head: yesyes\r
65 Content-Length: 9\r
66 \r
67 contents
68 </datacheck>
69 </reply>
70
71 #
72 # Client-side
73 <client>
74 <server>
75 http
76 </server>
77  <name>
78 HTTP, proxy with --anyauth and Location: to new host
79  </name>
80  <command>
81 http://first.host.it.is/we/want/that/page/10871000 -x %HOSTIP:%HTTPPORT --user iam:myself --location --anyauth
82 </command>
83 </client>
84
85 #
86 # Verify data after the test has been "shot"
87 <verify>
88 <strip>
89 ^User-Agent:.*
90 </strip>
91 <protocol>
92 GET http://first.host.it.is/we/want/that/page/10871000 HTTP/1.1\r
93 Host: first.host.it.is\r
94 Accept: */*\r
95 \r
96 GET http://first.host.it.is/we/want/that/page/10871000 HTTP/1.1\r
97 Host: first.host.it.is\r
98 Authorization: Basic aWFtOm15c2VsZg==\r
99 Accept: */*\r
100 \r
101 GET http://goto.second.host.now/10871002 HTTP/1.1\r
102 Host: goto.second.host.now\r
103 Accept: */*\r
104 \r
105 </protocol>
106 </verify>
107 </testcase>