test1073 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. # Server-side
  15. <reply>
  16. <data>
  17. HTTP/1.0 301 Redirect swsclose
  18. Server: testcurl
  19. Content-Type: text/plain
  20. Location: /newlocation/%TESTNUMBER0002
  21. Content-Length: 0
  22. Connection: close
  23. </data>
  24. </reply>
  25. # Client-side
  26. <client>
  27. <server>
  28. http
  29. </server>
  30. <name>
  31. HTTP chunked PUT to HTTP 1.0 server with redirect
  32. </name>
  33. <command>
  34. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T - -L
  35. </command>
  36. <stdin>
  37. This is data we upload with PUT
  38. it comes from stdin so MUST be sent
  39. with chunked encoding
  40. which is impossible in HTTP/1.0
  41. </stdin>
  42. </client>
  43. # Verify data after the test has been "shot"
  44. <verify>
  45. <errorcode>
  46. 25
  47. </errorcode>
  48. <protocol>
  49. PUT /%TESTNUMBER HTTP/1.1
  50. Host: %HOSTIP:%HTTPPORT
  51. User-Agent: curl/%VERSION
  52. Accept: */*
  53. Transfer-Encoding: chunked
  54. Expect: 100-continue
  55. %if hyper
  56. 7A
  57. %else
  58. 7a
  59. %endif
  60. This is data we upload with PUT
  61. it comes from stdin so MUST be sent
  62. with chunked encoding
  63. which is impossible in HTTP/1.0
  64. 0
  65. </protocol>
  66. </verify>
  67. </testcase>