test1285 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. HTTP Digest auth
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 401 authentication please swsbounce
  13. Server: Microsoft-IIS/6.0
  14. WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
  15. Content-Type: text/html; charset=iso-8859-1
  16. Content-Length: 0
  17. </data>
  18. <data1000>
  19. HTTP/1.1 200 A OK
  20. Server: Microsoft-IIS/6.0
  21. Content-Type: text/html; charset=iso-8859-1
  22. Content-Length: 3
  23. ok
  24. </data1000>
  25. <datacheck>
  26. HTTP/1.1 401 authentication please swsbounce
  27. Server: Microsoft-IIS/6.0
  28. WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
  29. Content-Type: text/html; charset=iso-8859-1
  30. Content-Length: 0
  31. HTTP/1.1 200 A OK
  32. Server: Microsoft-IIS/6.0
  33. Content-Type: text/html; charset=iso-8859-1
  34. Content-Length: 3
  35. ok
  36. </datacheck>
  37. </reply>
  38. # Client-side
  39. <client>
  40. #
  41. <server>
  42. http
  43. </server>
  44. <features>
  45. !SSPI
  46. crypto
  47. </features>
  48. <name>
  49. HTTP PUT --digest with user-specified Content-Length header
  50. </name>
  51. # This test is to ensure 'Content-Length: 0' is sent while negotiating auth
  52. # even when there is a user-specified Content-Length header.
  53. # https://github.com/curl/curl/pull/1242
  54. <command>
  55. -H "Content-Length: 85" -u auser:apasswd --digest -T log/put1285 http://%HOSTIP:%HTTPPORT/1285
  56. </command>
  57. <file name="log/put1285">
  58. This is data we upload with PUT
  59. a second line
  60. line three
  61. four is the number of lines
  62. </file>
  63. </client>
  64. # Verify data after the test has been "shot"
  65. <verify>
  66. <strip>
  67. ^User-Agent:.*
  68. </strip>
  69. <protocol>
  70. PUT /1285 HTTP/1.1
  71. Host: %HOSTIP:%HTTPPORT
  72. Accept: */*
  73. Content-Length: 0
  74. PUT /1285 HTTP/1.1
  75. Host: %HOSTIP:%HTTPPORT
  76. Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1285", response="dc185587d5e8391b347eef194c2a3cd6"
  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>