| xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 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
 | 
 | 14 | Server: Microsoft-IIS/6.0
 | 
 | 15 | WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
 | 
 | 16 | Content-Type: text/html; charset=iso-8859-1
 | 
 | 17 | Content-Length: 0
 | 
 | 18 | 
 | 
 | 19 | </data> | 
 | 20 | <data1000> | 
 | 21 | HTTP/1.1 200 A OK
 | 
 | 22 | Server: Microsoft-IIS/6.0
 | 
 | 23 | Content-Type: text/html; charset=iso-8859-1
 | 
 | 24 | Content-Length: 3
 | 
 | 25 | 
 | 
 | 26 | ok | 
 | 27 | </data1000> | 
 | 28 |  | 
 | 29 | <datacheck> | 
 | 30 | HTTP/1.1 401 authentication please swsbounce
 | 
 | 31 | Server: Microsoft-IIS/6.0
 | 
 | 32 | WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
 | 
 | 33 | Content-Type: text/html; charset=iso-8859-1
 | 
 | 34 | Content-Length: 0
 | 
 | 35 | 
 | 
 | 36 | HTTP/1.1 200 A OK
 | 
 | 37 | Server: Microsoft-IIS/6.0
 | 
 | 38 | Content-Type: text/html; charset=iso-8859-1
 | 
 | 39 | Content-Length: 3
 | 
 | 40 | 
 | 
 | 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/put%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER | 
 | 64 | </command> | 
 | 65 | <file name="log/put%TESTNUMBER"> | 
 | 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 | <protocol> | 
 | 76 | PUT /%TESTNUMBER HTTP/1.1
 | 
 | 77 | Host: %HOSTIP:%HTTPPORT
 | 
 | 78 | User-Agent: curl/%VERSION
 | 
 | 79 | Accept: */*
 | 
 | 80 | Content-Length: 0
 | 
 | 81 | 
 | 
 | 82 | PUT /%TESTNUMBER HTTP/1.1
 | 
 | 83 | Host: %HOSTIP:%HTTPPORT
 | 
 | 84 | Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="dc185587d5e8391b347eef194c2a3cd6"
 | 
 | 85 | User-Agent: curl/%VERSION
 | 
 | 86 | Accept: */*
 | 
 | 87 | Content-Length: 85
 | 
 | 88 | Expect: 100-continue
 | 
 | 89 | 
 | 
 | 90 | This is data we upload with PUT | 
 | 91 | a second line | 
 | 92 | line three | 
 | 93 | four is the number of lines | 
 | 94 | </protocol> | 
 | 95 | </verify> | 
 | 96 | </testcase> |