test1072 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <testcase>
  2. # Authorization 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 Digest auth
  10. --anyauth
  11. HTTP/1.0
  12. chunked Transfer-Encoding
  13. </keywords>
  14. </info>
  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: 0
  25. Connection: close
  26. </data>
  27. </reply>
  28. # Client-side
  29. <client>
  30. <server>
  31. http
  32. </server>
  33. <features>
  34. crypto
  35. </features>
  36. <name>
  37. HTTP chunked PUT to HTTP 1.0 server with authorization
  38. </name>
  39. <command>
  40. http://%HOSTIP:%HTTPPORT/1072 -T - -u testuser:testpass --anyauth
  41. </command>
  42. <stdin>
  43. This is data we upload with PUT
  44. it comes from stdin so MUST be sent
  45. with chunked encoding
  46. which is impossible in HTTP/1.0
  47. </stdin>
  48. </client>
  49. # Verify data after the test has been "shot"
  50. <verify>
  51. <errorcode>
  52. 25
  53. </errorcode>
  54. <strip>
  55. ^User-Agent:.*
  56. </strip>
  57. <protocol>
  58. PUT /1072 HTTP/1.1
  59. Host: %HOSTIP:%HTTPPORT
  60. Accept: */*
  61. Transfer-Encoding: chunked
  62. Expect: 100-continue
  63. 7a
  64. This is data we upload with PUT
  65. it comes from stdin so MUST be sent
  66. with chunked encoding
  67. which is impossible in HTTP/1.0
  68. 0
  69. </protocol>
  70. </verify>
  71. </testcase>