xref: /curl/tests/data/test317 (revision 3fd80c7b)
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP proxy
6HTTP Basic auth
7HTTP proxy Basic auth
8followlocation
9</keywords>
10</info>
11#
12# Server-side
13<reply>
14<data>
15HTTP/1.1 302 OK
16Date: Tue, 09 Nov 2010 14:49:00 GMT
17Server: test-server/fake swsclose
18Content-Type: text/html
19Funny-head: yesyes
20Location: http://goto.second.host.now/%TESTNUMBER0002
21Content-Length: 8
22Connection: close
23
24contents
25</data>
26<data2>
27HTTP/1.1 200 OK
28Date: Tue, 09 Nov 2010 14:49:00 GMT
29Server: test-server/fake swsclose
30Content-Type: text/html
31Funny-head: yesyes
32Content-Length: 9
33
34contents
35</data2>
36
37<datacheck>
38HTTP/1.1 302 OK
39Date: Tue, 09 Nov 2010 14:49:00 GMT
40Server: test-server/fake swsclose
41Content-Type: text/html
42Funny-head: yesyes
43Location: http://goto.second.host.now/%TESTNUMBER0002
44Content-Length: 8
45Connection: close
46
47HTTP/1.1 200 OK
48Date: Tue, 09 Nov 2010 14:49:00 GMT
49Server: test-server/fake swsclose
50Content-Type: text/html
51Funny-head: yesyes
52Content-Length: 9
53
54contents
55</datacheck>
56</reply>
57
58#
59# Client-side
60<client>
61<server>
62http
63</server>
64<name>
65HTTP with custom Authorization: and redirect to new host
66</name>
67<command>
68http://first.host.it.is/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT -H "Authorization: s3cr3t" --proxy-user testing:this --location
69</command>
70<features>
71proxy
72</features>
73</client>
74
75#
76# Verify data after the test has been "shot"
77<verify>
78<protocol>
79GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1
80Host: first.host.it.is
81Proxy-Authorization: Basic dGVzdGluZzp0aGlz
82User-Agent: curl/%VERSION
83Accept: */*
84Proxy-Connection: Keep-Alive
85Authorization: s3cr3t
86
87GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1
88Host: goto.second.host.now
89Proxy-Authorization: Basic dGVzdGluZzp0aGlz
90User-Agent: curl/%VERSION
91Accept: */*
92Proxy-Connection: Keep-Alive
93
94</protocol>
95</verify>
96</testcase>
97