test1072 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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/%TESTNUMBER -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. <protocol>
  55. PUT /%TESTNUMBER HTTP/1.1
  56. Host: %HOSTIP:%HTTPPORT
  57. User-Agent: curl/%VERSION
  58. Accept: */*
  59. Transfer-Encoding: chunked
  60. Expect: 100-continue
  61. %if hyper
  62. 7A
  63. %else
  64. 7a
  65. %endif
  66. This is data we upload with PUT
  67. it comes from stdin so MUST be sent
  68. with chunked encoding
  69. which is impossible in HTTP/1.0
  70. 0
  71. </protocol>
  72. </verify>
  73. </testcase>