lh | 9ed821d | 2023-04-07 01:36:19 -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 | <servercmd> |
| 13 | auth_required |
| 14 | </servercmd> |
| 15 | <data> |
| 16 | HTTP/1.1 401 Authorization Required swsclose
|
| 17 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 18 | WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
|
| 19 | Content-Type: text/html; charset=iso-8859-1
|
| 20 | Connection: close
|
| 21 |
|
| 22 | This 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> |
| 28 | HTTP/1.1 200 OK swsclose
|
| 29 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 30 | Content-Type: text/html; charset=iso-8859-1
|
| 31 | Connection: close
|
| 32 |
|
| 33 | This IS the real page! |
| 34 | </data1000> |
| 35 | |
| 36 | <datacheck> |
| 37 | HTTP/1.1 401 Authorization Required swsclose
|
| 38 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 39 | WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
|
| 40 | Content-Type: text/html; charset=iso-8859-1
|
| 41 | Connection: close
|
| 42 |
|
| 43 | HTTP/1.1 200 OK swsclose
|
| 44 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 45 | Content-Type: text/html; charset=iso-8859-1
|
| 46 | Connection: close
|
| 47 |
|
| 48 | This IS the real page! |
| 49 | </datacheck> |
| 50 | |
| 51 | </reply> |
| 52 | |
| 53 | # Client-side |
| 54 | <client> |
| 55 | <server> |
| 56 | http |
| 57 | </server> |
| 58 | <features> |
| 59 | !SSPI |
| 60 | crypto |
| 61 | </features> |
| 62 | <name> |
| 63 | HTTP PUT with Digest authorization |
| 64 | </name> |
| 65 | <command> |
| 66 | http://%HOSTIP:%HTTPPORT/88 -T log/put88 -u testuser:testpass --digest |
| 67 | </command> |
| 68 | <file name="log/put88"> |
| 69 | This is data we upload with PUT |
| 70 | a second line |
| 71 | line three |
| 72 | four is the number of lines |
| 73 | </file> |
| 74 | </client> |
| 75 | |
| 76 | # Verify data after the test has been "shot" |
| 77 | <verify> |
| 78 | <strip> |
| 79 | ^User-Agent:.* |
| 80 | </strip> |
| 81 | <protocol> |
| 82 | PUT /88 HTTP/1.1
|
| 83 | Host: %HOSTIP:%HTTPPORT
|
| 84 | Accept: */*
|
| 85 | Content-Length: 0
|
| 86 |
|
| 87 | PUT /88 HTTP/1.1
|
| 88 | Host: %HOSTIP:%HTTPPORT
|
| 89 | Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/88", response="78a49fa53d0c228778297687d4168e71"
|
| 90 | User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
|
| 91 | Accept: */*
|
| 92 | Content-Length: 85
|
| 93 | Expect: 100-continue
|
| 94 |
|
| 95 | This is data we upload with PUT |
| 96 | a second line |
| 97 | line three |
| 98 | four is the number of lines |
| 99 | </protocol> |
| 100 | </verify> |
| 101 | </testcase> |