| 1 |
<testcase> |
| 2 |
<info> |
| 3 |
<keywords> |
| 4 |
HTTP |
| 5 |
HTTP POST |
| 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 POST --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: 11" -u auser:apasswd --digest -d "junkelijunk" http://%HOSTIP:%HTTPPORT/1284 |
| 64 |
</command> |
| 65 |
</client> |
| 66 |
|
| 67 |
# Verify data after the test has been "shot" |
| 68 |
<verify> |
| 69 |
<strip> |
| 70 |
^User-Agent:.* |
| 71 |
</strip> |
| 72 |
<protocol nonewline="yes"> |
| 73 |
POST /1284 HTTP/1.1 |
| 74 |
Host: %HOSTIP:%HTTPPORT |
| 75 |
Accept: */* |
| 76 |
Content-Length: 0 |
| 77 |
Content-Type: application/x-www-form-urlencoded |
| 78 |
|
| 79 |
POST /1284 HTTP/1.1 |
| 80 |
Host: %HOSTIP:%HTTPPORT |
| 81 |
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1284", response="5763079608de439072861a59ac733515" |
| 82 |
Accept: */* |
| 83 |
Content-Length: 11 |
| 84 |
Content-Type: application/x-www-form-urlencoded |
| 85 |
|
| 86 |
junkelijunk |
| 87 |
</protocol> |
| 88 |
</verify> |
| 89 |
</testcase> |