test1052 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. followlocation
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.0 301 Redirect swsclose
  13. Date: Thu, 29 Jul 2008 14:49:00 GMT
  14. Server: test-server/fake
  15. Location: data/10520002.txt?coolsite=yes
  16. Content-Length: 0
  17. Connection: close
  18. </data>
  19. <data2>
  20. HTTP/1.0 200 Followed here fine swsclose
  21. Date: Thu, 29 Jul 2008 14:49:00 GMT
  22. Server: test-server/fake
  23. Content-Length: 51
  24. If this is received, the location following worked
  25. </data2>
  26. <datacheck>
  27. HTTP/1.0 301 Redirect swsclose
  28. Date: Thu, 29 Jul 2008 14:49:00 GMT
  29. Server: test-server/fake
  30. Location: data/10520002.txt?coolsite=yes
  31. Content-Length: 0
  32. Connection: close
  33. HTTP/1.0 200 Followed here fine swsclose
  34. Date: Thu, 29 Jul 2008 14:49:00 GMT
  35. Server: test-server/fake
  36. Content-Length: 51
  37. If this is received, the location following worked
  38. </datacheck>
  39. </reply>
  40. # Client-side
  41. <client>
  42. <server>
  43. http
  44. </server>
  45. <name>
  46. HTTP 1.0 PUT with Location: following
  47. </name>
  48. <command>
  49. http://%HOSTIP:%HTTPPORT/want/1052 -0 -L -T log/test1052.txt
  50. </command>
  51. <file name="log/test1052.txt">
  52. Weird
  53. file
  54. to
  55. upload
  56. for
  57. testing
  58. the
  59. PUT
  60. feature
  61. </file>
  62. </client>
  63. # Verify data after the test has been "shot"
  64. <verify>
  65. <strip>
  66. ^User-Agent:.*
  67. </strip>
  68. # The primary reason libcurl sends the data part twice in this test is that
  69. # the test HTTP server is blocking until it has read the entire request,
  70. # including the full request-body before it responds. So in this test the
  71. # server says 301 and 200 _after_ the entire PUT body has been sent.
  72. <protocol>
  73. PUT /want/1052 HTTP/1.0
  74. Host: %HOSTIP:%HTTPPORT
  75. Accept: */*
  76. Content-Length: 78
  77. Weird
  78. file
  79. to
  80. upload
  81. for
  82. testing
  83. the
  84. PUT
  85. feature
  86. PUT /want/data/10520002.txt?coolsite=yes HTTP/1.0
  87. Host: %HOSTIP:%HTTPPORT
  88. Accept: */*
  89. Content-Length: 78
  90. Weird
  91. file
  92. to
  93. upload
  94. for
  95. testing
  96. the
  97. PUT
  98. feature
  99. </protocol>
  100. </verify>
  101. </testcase>