test330 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. followlocation
  6. cookies
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 302 OK
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake swsclose
  16. Content-Type: text/html
  17. Funny-head: yesyes
  18. Location: http://goto.second.host.now/3170002
  19. Content-Length: 8
  20. Connection: close
  21. contents
  22. </data>
  23. <data2>
  24. HTTP/1.1 200 OK
  25. Date: Thu, 09 Nov 2010 14:49:00 GMT
  26. Server: test-server/fake swsclose
  27. Content-Type: text/html
  28. Funny-head: yesyes
  29. Content-Length: 9
  30. contents
  31. </data2>
  32. <datacheck>
  33. HTTP/1.1 302 OK
  34. Date: Thu, 09 Nov 2010 14:49:00 GMT
  35. Server: test-server/fake swsclose
  36. Content-Type: text/html
  37. Funny-head: yesyes
  38. Location: http://goto.second.host.now/3170002
  39. Content-Length: 8
  40. Connection: close
  41. HTTP/1.1 200 OK
  42. Date: Thu, 09 Nov 2010 14:49:00 GMT
  43. Server: test-server/fake swsclose
  44. Content-Type: text/html
  45. Funny-head: yesyes
  46. Content-Length: 9
  47. contents
  48. </datacheck>
  49. </reply>
  50. #
  51. # Client-side
  52. <client>
  53. <server>
  54. http
  55. </server>
  56. <name>
  57. HTTP with custom Cookie: and redirect to new host
  58. </name>
  59. <command>
  60. http://first.host.it.is/we/want/that/page/317 -x %HOSTIP:%HTTPPORT -H "Cookie: test=yes" --location
  61. </command>
  62. </client>
  63. #
  64. # Verify data after the test has been "shot"
  65. <verify>
  66. <strip>
  67. ^User-Agent:.*
  68. </strip>
  69. <protocol>
  70. GET http://first.host.it.is/we/want/that/page/317 HTTP/1.1
  71. Host: first.host.it.is
  72. Accept: */*
  73. Proxy-Connection: Keep-Alive
  74. Cookie: test=yes
  75. GET http://goto.second.host.now/3170002 HTTP/1.1
  76. Host: goto.second.host.now
  77. Accept: */*
  78. Proxy-Connection: Keep-Alive
  79. </protocol>
  80. </verify>
  81. </testcase>