| xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | <testcase> | 
 | 2 | # Authorization is used to force curl to realize that the server is | 
 | 3 | # speaking HTTP 1.0. The request must be resent with the correct | 
 | 4 | # authorization header, but using HTTP 1.0, not 1.1. | 
 | 5 | <info> | 
 | 6 | <keywords> | 
 | 7 | HTTP | 
 | 8 | HTTP PUT | 
 | 9 | HTTP Digest auth | 
 | 10 | --anyauth | 
 | 11 | HTTP/1.0 | 
 | 12 | </keywords> | 
 | 13 | </info> | 
 | 14 |  | 
 | 15 | # Server-side | 
 | 16 | <reply> | 
 | 17 | <data> | 
 | 18 | HTTP/1.0 401 Authorization Required swsclose
 | 
 | 19 | Server: testcurl
 | 
 | 20 | WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
 | 
 | 21 | WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
 | 
 | 22 | WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
 | 
 | 23 | Content-Type: text/plain
 | 
 | 24 | Content-Length: 35
 | 
 | 25 | Connection: close
 | 
 | 26 | 
 | 
 | 27 | Try again on this HTTP 1.0 server! | 
 | 28 | </data> | 
 | 29 |  | 
 | 30 | # This is supposed to be returned when the server gets a | 
 | 31 | # Authorization: Digest line passed-in from the client | 
 | 32 | <data1000> | 
 | 33 | HTTP/1.0 200 OK swsclose
 | 
 | 34 | Server: testcurl
 | 
 | 35 | Content-Type: text/plain
 | 
 | 36 | Content-Length: 23
 | 
 | 37 | Connection: close
 | 
 | 38 | 
 | 
 | 39 | This IS the real page! | 
 | 40 | </data1000> | 
 | 41 |  | 
 | 42 | <datacheck> | 
 | 43 | HTTP/1.0 401 Authorization Required swsclose
 | 
 | 44 | Server: testcurl
 | 
 | 45 | WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
 | 
 | 46 | WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
 | 
 | 47 | WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
 | 
 | 48 | Content-Type: text/plain
 | 
 | 49 | Content-Length: 35
 | 
 | 50 | Connection: close
 | 
 | 51 | 
 | 
 | 52 | HTTP/1.0 200 OK swsclose
 | 
 | 53 | Server: testcurl
 | 
 | 54 | Content-Type: text/plain
 | 
 | 55 | Content-Length: 23
 | 
 | 56 | Connection: close
 | 
 | 57 | 
 | 
 | 58 | This IS the real page! | 
 | 59 | </datacheck> | 
 | 60 |  | 
 | 61 | </reply> | 
 | 62 |  | 
 | 63 | # Client-side | 
 | 64 | <client> | 
 | 65 | <server> | 
 | 66 | http | 
 | 67 | </server> | 
 | 68 | <features> | 
 | 69 | !SSPI | 
 | 70 | crypto | 
 | 71 | </features> | 
 | 72 |  <name> | 
 | 73 | Downgraded HTTP PUT to HTTP 1.0 with authorization | 
 | 74 |  </name> | 
 | 75 |  <command> | 
 | 76 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth | 
 | 77 | </command> | 
 | 78 | <file name="log/put%TESTNUMBER"> | 
 | 79 | This is data we upload with PUT | 
 | 80 | a second line | 
 | 81 | line three | 
 | 82 | four is the number of lines | 
 | 83 | </file> | 
 | 84 | </client> | 
 | 85 |  | 
 | 86 | # Verify data after the test has been "shot" | 
 | 87 | <verify> | 
 | 88 | <protocol> | 
 | 89 | PUT /%TESTNUMBER HTTP/1.1
 | 
 | 90 | Host: %HOSTIP:%HTTPPORT
 | 
 | 91 | User-Agent: curl/%VERSION
 | 
 | 92 | Accept: */*
 | 
 | 93 | Content-Length: 85
 | 
 | 94 | Expect: 100-continue
 | 
 | 95 | 
 | 
 | 96 | This is data we upload with PUT | 
 | 97 | a second line | 
 | 98 | line three | 
 | 99 | four is the number of lines | 
 | 100 | PUT /%TESTNUMBER HTTP/1.0
 | 
 | 101 | Host: %HOSTIP:%HTTPPORT
 | 
 | 102 | Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="df4cef6b52a30e65d472dd848d2055a1"
 | 
 | 103 | User-Agent: curl/%VERSION
 | 
 | 104 | Accept: */*
 | 
 | 105 | Content-Length: 85
 | 
 | 106 | 
 | 
 | 107 | This is data we upload with PUT | 
 | 108 | a second line | 
 | 109 | line three | 
 | 110 | four is the number of lines | 
 | 111 | </protocol> | 
 | 112 | </verify> | 
 | 113 | </testcase> |