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 | --anyauth |
| 8 | </keywords> |
| 9 | </info> |
| 10 | |
| 11 | # Server-side |
| 12 | <reply> |
| 13 | <data> |
| 14 | HTTP/1.1 401 Authorization Required
|
| 15 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 16 | WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
|
| 17 | WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
|
| 18 | WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
|
| 19 | Content-Length: 26
|
| 20 | Content-Type: text/html; charset=iso-8859-1
|
| 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
|
| 29 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 30 | Content-Type: text/html; charset=iso-8859-1
|
| 31 | Content-Length: 23
|
| 32 | Connection: close
|
| 33 |
|
| 34 | This IS the real page! |
| 35 | </data1000> |
| 36 | |
| 37 | <datacheck> |
| 38 | HTTP/1.1 401 Authorization Required
|
| 39 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 40 | WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
|
| 41 | WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
|
| 42 | WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
|
| 43 | Content-Length: 26
|
| 44 | Content-Type: text/html; charset=iso-8859-1
|
| 45 |
|
| 46 | HTTP/1.1 200 OK
|
| 47 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 48 | Content-Type: text/html; charset=iso-8859-1
|
| 49 | Content-Length: 23
|
| 50 | Connection: close
|
| 51 |
|
| 52 | This IS the real page! |
| 53 | </datacheck> |
| 54 | |
| 55 | </reply> |
| 56 | |
| 57 | # Client-side |
| 58 | <client> |
| 59 | <server> |
| 60 | http |
| 61 | </server> |
| 62 | <features> |
| 63 | !SSPI |
| 64 | crypto |
| 65 | </features> |
| 66 | <name> |
| 67 | HTTP PUT with --anyauth authorization (picking Digest) |
| 68 | </name> |
| 69 | <command> |
| 70 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth |
| 71 | </command> |
| 72 | <file name="log/put%TESTNUMBER"> |
| 73 | This is data we upload with PUT |
| 74 | a second line |
| 75 | line three |
| 76 | four is the number of lines |
| 77 | </file> |
| 78 | </client> |
| 79 | |
| 80 | # Verify data after the test has been "shot" |
| 81 | <verify> |
| 82 | <protocol> |
| 83 | PUT /%TESTNUMBER HTTP/1.1
|
| 84 | Host: %HOSTIP:%HTTPPORT
|
| 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 | PUT /%TESTNUMBER HTTP/1.1
|
| 95 | Host: %HOSTIP:%HTTPPORT
|
| 96 | Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="01cb59db1ddaac246b072d5f5f0716d9"
|
| 97 | User-Agent: curl/%VERSION
|
| 98 | Accept: */*
|
| 99 | Content-Length: 85
|
| 100 | Expect: 100-continue
|
| 101 |
|
| 102 | This is data we upload with PUT |
| 103 | a second line |
| 104 | line three |
| 105 | four is the number of lines |
| 106 | </protocol> |
| 107 | </verify> |
| 108 | </testcase> |