Dave Dribin made libcurl understand and handle cases when the server
[platform/upstream/curl.git] / tests / data / test273
1 <info>
2 <keywords>
3 HTTP
4 HTTP GET
5 HTTP Digest auth
6 </keywords>
7 </info>
8 # Server-side
9 <reply>
10 <data>
11 HTTP/1.1 401 Authorization Required swsclose\r
12 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
13 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"\r
14 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
15 Content-Type: text/html; charset=iso-8859-1\r
16 \r
17 This is not the real page
18 </data>
19
20 # This is supposed to be returned when the server gets a
21 # Authorization: Digest line passed-in from the client
22 <data1000>
23 HTTP/1.1 200 OK swsclose\r
24 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
25 Content-Type: text/html; charset=iso-8859-1\r
26 \r
27 This IS the real page!
28 </data1000>
29
30 <datacheck>
31 HTTP/1.1 401 Authorization Required swsclose\r
32 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
33 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"\r
34 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
35 Content-Type: text/html; charset=iso-8859-1\r
36 \r
37 HTTP/1.1 200 OK swsclose\r
38 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
39 Content-Type: text/html; charset=iso-8859-1\r
40 \r
41 This IS the real page!
42 </datacheck>
43
44 </reply>
45
46 # Client-side
47 <client>
48 <server>
49 http
50 </server>
51  <name>
52 HTTP with two Digest authorization headers
53  </name>
54  <command>
55 http://%HOSTIP:%HTTPPORT/273 -u testuser:testpass --digest
56 </command>
57 </client>
58
59 # Verify data after the test has been "shot"
60 <verify>
61 <strip>
62 ^User-Agent:.*
63 </strip>
64 <protocol>
65 GET /273 HTTP/1.1\r
66 Host: 127.0.0.1:%HTTPPORT\r
67 Accept: */*\r
68 \r
69 GET /273 HTTP/1.1\r
70 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/273", response="576ae57b1db0039f8c0de43ef58e49e3"\r
71 User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
72 Host: 127.0.0.1:%HTTPPORT\r
73 Accept: */*\r
74 \r
75 </protocol>
76 </verify>