Imported Upstream version 7.53.1
[platform/upstream/curl.git] / tests / data / test1285
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP PUT
6 HTTP Digest auth
7 </keywords>
8 </info>
9
10 # Server-side
11 <reply>
12 <data>
13 HTTP/1.1 401 authentication please swsbounce\r
14 Server: Microsoft-IIS/6.0\r
15 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
16 Content-Type: text/html; charset=iso-8859-1\r
17 Content-Length: 0\r
18 \r
19 </data>
20 <data1000>
21 HTTP/1.1 200 A OK\r
22 Server: Microsoft-IIS/6.0\r
23 Content-Type: text/html; charset=iso-8859-1\r
24 Content-Length: 3\r
25 \r
26 ok
27 </data1000>
28
29 <datacheck>
30 HTTP/1.1 401 authentication please swsbounce\r
31 Server: Microsoft-IIS/6.0\r
32 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
33 Content-Type: text/html; charset=iso-8859-1\r
34 Content-Length: 0\r
35 \r
36 HTTP/1.1 200 A OK\r
37 Server: Microsoft-IIS/6.0\r
38 Content-Type: text/html; charset=iso-8859-1\r
39 Content-Length: 3\r
40 \r
41 ok
42 </datacheck>
43
44 </reply>
45
46 # Client-side
47 <client>
48 #
49 <server>
50 http
51 </server>
52 <features>
53 !SSPI
54 crypto
55 </features>
56 <name>
57 HTTP PUT --digest with user-specified Content-Length header
58 </name>
59 # This test is to ensure 'Content-Length: 0' is sent while negotiating auth
60 # even when there is a user-specified Content-Length header.
61 # https://github.com/curl/curl/pull/1242
62 <command>
63 -H "Content-Length: 85" -u auser:apasswd --digest -T log/put1285 http://%HOSTIP:%HTTPPORT/1285
64 </command>
65 <file name="log/put1285">
66 This is data we upload with PUT
67 a second line
68 line three
69 four is the number of lines
70 </file>
71 </client>
72
73 # Verify data after the test has been "shot"
74 <verify>
75 <strip>
76 ^User-Agent:.*
77 </strip>
78 <protocol>
79 PUT /1285 HTTP/1.1\r
80 Host: %HOSTIP:%HTTPPORT\r
81 Accept: */*\r
82 Content-Length: 0\r
83 \r
84 PUT /1285 HTTP/1.1\r
85 Host: %HOSTIP:%HTTPPORT\r
86 Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1285", response="dc185587d5e8391b347eef194c2a3cd6"\r
87 Accept: */*\r
88 Content-Length: 85\r
89 Expect: 100-continue\r
90 \r
91 This is data we upload with PUT
92 a second line
93 line three
94 four is the number of lines
95 </protocol>
96 </verify>
97 </testcase>