Git init
[external/curl.git] / tests / data / test257
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 HTTP proxy
7 HTTP Basic auth
8 followlocation
9 netrc
10 </keywords>
11 </info>
12
13 # Server-side
14 <reply>
15 <data>
16 HTTP/1.1 301 This is a weirdo text message swsclose
17 Date: Thu, 09 Nov 2010 14:49:00 GMT
18 Server: test-server/fake
19 Location: http://anotherone.com/2570002
20 Connection: close
21
22 This server reply is for testing a simple Location: following
23
24 </data>
25 <data2>
26 HTTP/1.1 302 Followed here fine swsclose
27 Date: Thu, 09 Nov 2010 14:49:00 GMT
28 Server: test-server/fake
29 Location: http://athird.com/2570003
30
31 If this is received, the location following worked
32
33 </data2>
34 <data3>
35 HTTP/1.1 200 Followed here fine swsclose
36 Date: Thu, 09 Nov 2010 14:49:00 GMT
37 Server: test-server/fake
38 Content-Length: 52
39
40 If this is received, the location following worked
41
42 </data3>
43 <datacheck>
44 HTTP/1.1 301 This is a weirdo text message swsclose
45 Date: Thu, 09 Nov 2010 14:49:00 GMT
46 Server: test-server/fake
47 Location: http://anotherone.com/2570002
48 Connection: close
49
50 HTTP/1.1 302 Followed here fine swsclose
51 Date: Thu, 09 Nov 2010 14:49:00 GMT
52 Server: test-server/fake
53 Location: http://athird.com/2570003
54
55 HTTP/1.1 200 Followed here fine swsclose
56 Date: Thu, 09 Nov 2010 14:49:00 GMT
57 Server: test-server/fake
58 Content-Length: 52
59
60 If this is received, the location following worked
61
62 </datacheck>
63 </reply>
64
65 # Client-side
66 <client>
67 <features>
68 netrc_debug
69 </features>
70 <server>
71 http
72 </server>
73  <name>
74 HTTP Location: following with --netrc-optional
75  </name>
76  <command>
77 http://supersite.com/want/257 -L -x http://%HOSTIP:%HTTPPORT --netrc-optional
78 </command>
79
80 # netrc auth for two out of three sites:
81 <file name="log/netrc">
82 machine supersite.com login user1 password passwd1
83 machine anotherone.com login user2 password passwd2
84 </file>
85 </client>
86
87 # Verify data after the test has been "shot"
88 <verify>
89 <strip>
90 ^User-Agent:.*
91 </strip>
92 <protocol>
93 GET http://supersite.com/want/257 HTTP/1.1\r
94 Authorization: Basic dXNlcjE6cGFzc3dkMQ==\r
95 User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13\r
96 Host: supersite.com\r
97 Accept: */*\r
98 Proxy-Connection: Keep-Alive\r
99 \r
100 GET http://anotherone.com/2570002 HTTP/1.1\r
101 Authorization: Basic dXNlcjI6cGFzc3dkMg==\r
102 User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
103 Host: anotherone.com\r
104 Accept: */*\r
105 Proxy-Connection: Keep-Alive\r
106 \r
107 GET http://athird.com/2570003 HTTP/1.1\r
108 User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
109 Host: athird.com\r
110 Accept: */*\r
111 Proxy-Connection: Keep-Alive\r
112 \r
113 </protocol>
114 </verify>
115 </testcase>