| xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> | 
 | 2 | # Redirection is used to force curl to realize that the server is | 
 | 3 | # speaking HTTP 1.0. The request is impossible to satisfy with HTTP 1.0 | 
 | 4 | # because chunked encoding is unavailable, so the request must fail. | 
 | 5 | <info> | 
 | 6 | <keywords> | 
 | 7 | HTTP | 
 | 8 | HTTP PUT | 
 | 9 | HTTP/1.0 | 
 | 10 | followlocation | 
 | 11 | chunked Transfer-Encoding | 
 | 12 | </keywords> | 
 | 13 | </info> | 
 | 14 |  | 
 | 15 | # Server-side | 
 | 16 | <reply> | 
 | 17 | <data> | 
 | 18 | HTTP/1.0 301 Redirect swsclose
 | 
 | 19 | Server: testcurl
 | 
 | 20 | Content-Type: text/plain
 | 
 | 21 | Location: /newlocation/%TESTNUMBER0002
 | 
 | 22 | Content-Length: 0
 | 
 | 23 | Connection: close
 | 
 | 24 | 
 | 
 | 25 | </data> | 
 | 26 | </reply> | 
 | 27 |  | 
 | 28 | # Client-side | 
 | 29 | <client> | 
 | 30 | <server> | 
 | 31 | http | 
 | 32 | </server> | 
 | 33 |  <name> | 
 | 34 | HTTP chunked PUT to HTTP 1.0 server with redirect | 
 | 35 |  </name> | 
 | 36 |  <command> | 
 | 37 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T - -L | 
 | 38 | </command> | 
 | 39 | <stdin> | 
 | 40 | This is data we upload with PUT | 
 | 41 | it comes from stdin so MUST be sent | 
 | 42 | with chunked encoding | 
 | 43 | which is impossible in HTTP/1.0 | 
 | 44 | </stdin> | 
 | 45 | </client> | 
 | 46 |  | 
 | 47 | # Verify data after the test has been "shot" | 
 | 48 | <verify> | 
 | 49 | <errorcode> | 
 | 50 | 25 | 
 | 51 | </errorcode> | 
 | 52 | <protocol> | 
 | 53 | PUT /%TESTNUMBER HTTP/1.1
 | 
 | 54 | Host: %HOSTIP:%HTTPPORT
 | 
 | 55 | User-Agent: curl/%VERSION
 | 
 | 56 | Accept: */*
 | 
 | 57 | Transfer-Encoding: chunked
 | 
 | 58 | Expect: 100-continue
 | 
 | 59 | 
 | 
 | 60 | %if hyper | 
 | 61 | 7A
 | 
 | 62 | %else | 
 | 63 | 7a
 | 
 | 64 | %endif | 
 | 65 | This is data we upload with PUT | 
 | 66 | it comes from stdin so MUST be sent | 
 | 67 | with chunked encoding | 
 | 68 | which is impossible in HTTP/1.0 | 
 | 69 | 
 | 
 | 70 | 0
 | 
 | 71 | 
 | 
 | 72 | </protocol> | 
 | 73 | </verify> | 
 | 74 | </testcase> |