1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP PUT
6HTTP Digest auth
7--anyauth
8</keywords>
9</info>
10
11# Server-side
12<reply>
13<data>
14HTTP/1.1 401 Authorization Required
15Server: Apache/1.3.27 (Darwin) PHP/4.1.2
16WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
17WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
18WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
19Content-Length: 26
20Content-Type: text/html; charset=iso-8859-1
21
22This is not the real page
23</data>
24
25# This is supposed to be returned when the server gets a
26# Authorization: Digest line passed-in from the client
27<data1000>
28HTTP/1.1 200 OK
29Server: Apache/1.3.27 (Darwin) PHP/4.1.2
30Content-Type: text/html; charset=iso-8859-1
31Content-Length: 23
32Connection: close
33
34This IS the real page!
35</data1000>
36
37<datacheck>
38HTTP/1.1 401 Authorization Required
39Server: Apache/1.3.27 (Darwin) PHP/4.1.2
40WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
41WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
42WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
43Content-Length: 26
44Content-Type: text/html; charset=iso-8859-1
45
46HTTP/1.1 200 OK
47Server: Apache/1.3.27 (Darwin) PHP/4.1.2
48Content-Type: text/html; charset=iso-8859-1
49Content-Length: 23
50Connection: close
51
52This IS the real page!
53</datacheck>
54
55</reply>
56
57# Client-side
58<client>
59<server>
60http
61</server>
62<features>
63crypto
64</features>
65 <name>
66HTTP PUT with --anyauth authorization (picking Digest)
67 </name>
68 <command>
69http://%HOSTIP:%HTTPPORT/1030 -T log/put1030 -u testuser:testpass --anyauth
70</command>
71<file name="log/put1030">
72This is data we upload with PUT
73a second line
74line three
75four is the number of lines
76</file>
77</client>
78
79# Verify data after the test has been "shot"
80<verify>
81<strip>
82^User-Agent:.*
83</strip>
84<protocol>
85PUT /1030 HTTP/1.1
86Host: %HOSTIP:%HTTPPORT
87Accept: */*
88Content-Length: 85
89Expect: 100-continue
90
91This is data we upload with PUT
92a second line
93line three
94four is the number of lines
95PUT /1030 HTTP/1.1
96Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1030", response="01cb59db1ddaac246b072d5f5f0716d9"
97User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
98Host: %HOSTIP:%HTTPPORT
99Accept: */*
100Content-Length: 85
101Expect: 100-continue
102
103This is data we upload with PUT
104a second line
105line three
106four is the number of lines
107</protocol>
108</verify>
109</testcase>
110