test1071 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. # Server-side
  15. <reply>
  16. <data>
  17. HTTP/1.0 401 Authorization Required swsclose
  18. Server: testcurl
  19. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  20. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  21. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  22. Content-Type: text/plain
  23. Content-Length: 35
  24. Connection: close
  25. Try again on this HTTP 1.0 server!
  26. </data>
  27. # This is supposed to be returned when the server gets a
  28. # Authorization: Digest line passed-in from the client
  29. <data1000>
  30. HTTP/1.0 200 OK swsclose
  31. Server: testcurl
  32. Content-Type: text/plain
  33. Content-Length: 23
  34. Connection: close
  35. This IS the real page!
  36. </data1000>
  37. <datacheck>
  38. HTTP/1.0 401 Authorization Required swsclose
  39. Server: testcurl
  40. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  41. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  42. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  43. Content-Type: text/plain
  44. Content-Length: 35
  45. Connection: close
  46. HTTP/1.0 200 OK swsclose
  47. Server: testcurl
  48. Content-Type: text/plain
  49. Content-Length: 23
  50. Connection: close
  51. This IS the real page!
  52. </datacheck>
  53. </reply>
  54. # Client-side
  55. <client>
  56. <server>
  57. http
  58. </server>
  59. <features>
  60. !SSPI
  61. crypto
  62. </features>
  63. <name>
  64. Downgraded HTTP PUT to HTTP 1.0 with authorization
  65. </name>
  66. <command>
  67. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T %LOGDIR/put%TESTNUMBER -u testuser:testpass --anyauth
  68. </command>
  69. <file name="%LOGDIR/put%TESTNUMBER">
  70. This is data we upload with PUT
  71. a second line
  72. line three
  73. four is the number of lines
  74. </file>
  75. </client>
  76. # Verify data after the test has been "shot"
  77. <verify>
  78. <protocol>
  79. PUT /%TESTNUMBER HTTP/1.1
  80. Host: %HOSTIP:%HTTPPORT
  81. User-Agent: curl/%VERSION
  82. Accept: */*
  83. Content-Length: 85
  84. This is data we upload with PUT
  85. a second line
  86. line three
  87. four is the number of lines
  88. PUT /%TESTNUMBER HTTP/1.0
  89. Host: %HOSTIP:%HTTPPORT
  90. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="df4cef6b52a30e65d472dd848d2055a1"
  91. User-Agent: curl/%VERSION
  92. Accept: */*
  93. Content-Length: 85
  94. This is data we upload with PUT
  95. a second line
  96. line three
  97. four is the number of lines
  98. </protocol>
  99. </verify>
  100. </testcase>