test1285 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 %LOGDIR/put%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER
  56. </command>
  57. <file name="%LOGDIR/put%TESTNUMBER">
  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. <protocol>
  67. PUT /%TESTNUMBER HTTP/1.1
  68. Host: %HOSTIP:%HTTPPORT
  69. User-Agent: curl/%VERSION
  70. Accept: */*
  71. Content-Length: 0
  72. PUT /%TESTNUMBER HTTP/1.1
  73. Host: %HOSTIP:%HTTPPORT
  74. Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="dc185587d5e8391b347eef194c2a3cd6"
  75. User-Agent: curl/%VERSION
  76. Accept: */*
  77. Content-Length: 85
  78. This is data we upload with PUT
  79. a second line
  80. line three
  81. four is the number of lines
  82. </protocol>
  83. </verify>
  84. </testcase>