Modified the default HTTP headers used by libcurl:
[platform/upstream/curl.git] / tests / data / test153
1 # Server-side
2 <reply>
3 # reply back and ask for Digest auth
4 <data1>
5 HTTP/1.1 401 Authorization Required swsclose\r
6 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
7 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"\r
8 Content-Type: text/html; charset=iso-8859-1\r
9 \r
10 This is not the real page
11 </data1>
12
13 # This is supposed to be returned when the server gets a
14 # Authorization: Digest line passed-in from the client
15 <data1001>
16 HTTP/1.1 200 OK\r
17 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
18 Content-Type: text/html; charset=iso-8859-1\r
19 Content-Length: 23\r
20 \r
21 This IS the real page!
22 </data1001>
23
24 #
25 # This is the second request, and this sends back a response saying that
26 # the request contained stale data. We want an update. Set swsbounce to
27 # bounce on to data1003 on the second request.
28 <data1002>
29 HTTP/1.1 401 Authorization re-negotiation please swsbounce\r
30 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
31 WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"\r
32 Content-Type: text/html; charset=iso-8859-1\r
33 Content-Length: 25\r
34 \r
35 This is not the real page
36 </data1002>
37
38 # The second request to the 1002 section will bounce this one back instead
39 # thanks to the swsbounce keyword up there
40 <data1003>
41 HTTP/1.1 200 OK\r
42 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
43 Content-Type: text/html; charset=iso-8859-1\r
44 Content-Length: 30\r
45 \r
46 This IS the second real page!
47 </data1003>
48 </reply>
49
50 # Client-side
51 <client>
52 <server>
53 http
54 </server>
55  <name>
56 HTTP with Digest authorization with stale=true
57  </name>
58  <command>
59 http://%HOSTIP:%HTTPPORT/1530001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/1530002
60 </command>
61 </client>
62
63 # Verify data after the test has been "shot"
64 <verify>
65 <strip>
66 ^Authorization.*cnonce
67 ^User-Agent:.*
68 </strip>
69 <protocol>
70 GET /1530001 HTTP/1.1\r
71 Host: 127.0.0.1:%HTTPPORT\r
72 Accept: */*\r
73 \r
74 GET /1530001 HTTP/1.1\r
75 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530001", response="f4f83139396995bac665f24a1f1055c7"\r
76 User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
77 Host: 127.0.0.1:%HTTPPORT\r
78 Accept: */*\r
79 \r
80 GET /1530002 HTTP/1.1\r
81 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32"\r
82 User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS\r
83 Host: 127.0.0.1:%HTTPPORT\r
84 Accept: */*\r
85 \r
86 GET /1530002 HTTP/1.1\r
87 Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/1530002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm="MD5"\r
88 User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS\r
89 Host: 127.0.0.1:%HTTPPORT\r
90 Accept: */*\r
91 \r
92 </protocol>
93 <stdout>
94 HTTP/1.1 401 Authorization Required swsclose\r
95 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
96 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"\r
97 Content-Type: text/html; charset=iso-8859-1\r
98 \r
99 HTTP/1.1 200 OK\r
100 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
101 Content-Type: text/html; charset=iso-8859-1\r
102 Content-Length: 23\r
103 \r
104 This IS the real page!
105 HTTP/1.1 401 Authorization re-negotiation please swsbounce\r
106 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
107 WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"\r
108 Content-Type: text/html; charset=iso-8859-1\r
109 Content-Length: 25\r
110 \r
111 HTTP/1.1 200 OK\r
112 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
113 Content-Type: text/html; charset=iso-8859-1\r
114 Content-Length: 30\r
115 \r
116 This IS the second real page!
117 </stdout>
118 </verify>