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