xref: /curl/tests/data/test154 (revision 3fd80c7b)
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 swsclose
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-Type: text/html; charset=iso-8859-1
20Connection: close
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 swsclose
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 swsclose
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-Type: text/html; charset=iso-8859-1
44Connection: close
45
46HTTP/1.1 200 OK swsclose
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>
63!SSPI
64crypto
65</features>
66<name>
67HTTP PUT with --anyauth authorization (picking Digest)
68</name>
69<command>
70http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T %LOGDIR/put%TESTNUMBER -u testuser:testpass --anyauth
71</command>
72<file name="%LOGDIR/put%TESTNUMBER">
73This is data we upload with PUT
74a second line
75line three
76four is the number of lines
77</file>
78</client>
79
80# Verify data after the test has been "shot"
81<verify>
82<protocol>
83PUT /%TESTNUMBER HTTP/1.1
84Host: %HOSTIP:%HTTPPORT
85User-Agent: curl/%VERSION
86Accept: */*
87Content-Length: 85
88
89This is data we upload with PUT
90a second line
91line three
92four is the number of lines
93PUT /%TESTNUMBER HTTP/1.1
94Host: %HOSTIP:%HTTPPORT
95Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="b71551e12d1c456e47d8388ecb2edeca"
96User-Agent: curl/%VERSION
97Accept: */*
98Content-Length: 85
99
100This is data we upload with PUT
101a second line
102line three
103four is the number of lines
104</protocol>
105</verify>
106</testcase>
107