test184 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP proxy
  7. followlocation
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 301 OK swsbounce
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Content-Length: 4
  16. Location: http://yet.another.host/184
  17. moo
  18. </data>
  19. <data1>
  20. HTTP/1.1 200 OK
  21. Date: Thu, 09 Nov 2010 14:49:00 GMT
  22. Content-Length: 4
  23. moo
  24. </data1>
  25. <datacheck>
  26. HTTP/1.1 301 OK swsbounce
  27. Date: Thu, 09 Nov 2010 14:49:00 GMT
  28. Content-Length: 4
  29. Location: http://yet.another.host/184
  30. HTTP/1.1 200 OK
  31. Date: Thu, 09 Nov 2010 14:49:00 GMT
  32. Content-Length: 4
  33. moo
  34. </datacheck>
  35. </reply>
  36. # Client-side
  37. <client>
  38. <server>
  39. http
  40. </server>
  41. <name>
  42. HTTP replace Host: when following Location: to new host
  43. </name>
  44. <command>
  45. http://deathstar.another.galaxy/184 -L -H "Host: another.visitor.stay.a.while.stay.foreeeeeever" --proxy http://%HOSTIP:%HTTPPORT
  46. </command>
  47. </client>
  48. # Verify data after the test has been "shot"
  49. <verify>
  50. <strip>
  51. ^User-Agent: curl/.*
  52. </strip>
  53. <protocol>
  54. GET http://deathstar.another.galaxy/184 HTTP/1.1
  55. User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.6b zlib/1.1.4 libidn/0.4.6
  56. Accept: */*
  57. Proxy-Connection: Keep-Alive
  58. Host: another.visitor.stay.a.while.stay.foreeeeeever
  59. GET http://yet.another.host/184 HTTP/1.1
  60. Host: yet.another.host
  61. Accept: */*
  62. Proxy-Connection: Keep-Alive
  63. </protocol>
  64. </verify>
  65. </testcase>