test330 1.6 KB

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