test1075 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. HTTP Basic auth
  7. --anyauth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. # The test server provides no way to respond differently to a subsequent
  13. # Basic authenticated request (we really want to respond with 200 for
  14. # the second), so just respond with 401 for both and let curl deal with it.
  15. <data>
  16. HTTP/1.1 401 Authorization Required
  17. Server: testcurl
  18. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  19. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  20. WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
  21. Content-Type: text/plain
  22. Content-Length: 0
  23. </data>
  24. <datacheck>
  25. HTTP/1.1 401 Authorization Required
  26. Server: testcurl
  27. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  28. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  29. WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
  30. Content-Type: text/plain
  31. Content-Length: 0
  32. HTTP/1.1 401 Authorization Required
  33. Server: testcurl
  34. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  35. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  36. WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
  37. Content-Type: text/plain
  38. Content-Length: 0
  39. </datacheck>
  40. </reply>
  41. # Client-side
  42. <client>
  43. <server>
  44. http
  45. </server>
  46. <name>
  47. HTTP PUT with --anyauth authorization (picking Basic)
  48. </name>
  49. <command>
  50. http://%HOSTIP:%HTTPPORT/1075 -T log/put1075 -u testuser:testpass --anyauth
  51. </command>
  52. <file name="log/put1075">
  53. This is data we upload with PUT
  54. a second line
  55. line three
  56. four is the number of lines
  57. </file>
  58. </client>
  59. # Verify data after the test has been "shot"
  60. <verify>
  61. <strip>
  62. ^User-Agent:.*
  63. </strip>
  64. <protocol>
  65. PUT /1075 HTTP/1.1
  66. Host: %HOSTIP:%HTTPPORT
  67. Accept: */*
  68. Content-Length: 85
  69. Expect: 100-continue
  70. This is data we upload with PUT
  71. a second line
  72. line three
  73. four is the number of lines
  74. PUT /1075 HTTP/1.1
  75. Host: %HOSTIP:%HTTPPORT
  76. Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
  77. Accept: */*
  78. Content-Length: 85
  79. Expect: 100-continue
  80. This is data we upload with PUT
  81. a second line
  82. line three
  83. four is the number of lines
  84. </protocol>
  85. </verify>
  86. </testcase>