test1081 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. redirect_url
  7. followlocation
  8. --write-out
  9. </keywords>
  10. </info>
  11. # Server-side
  12. <reply>
  13. <data nocheck="yes">
  14. HTTP/1.1 301 This is a weirdo text message swsclose
  15. Location: data/%TESTNUMBER0099.txt?coolsite=yes
  16. Content-Length: 62
  17. Connection: close
  18. This server reply is for testing a simple Location: following
  19. </data>
  20. <data2 nocheck="yes">
  21. HTTP/1.1 200 Followed here fine swsclose
  22. Date: Tue, 09 Nov 2010 14:49:00 GMT
  23. Server: test-server/fake
  24. Content-Length: 41
  25. This second URL does not have a location
  26. </data2>
  27. </reply>
  28. # Client-side
  29. <client>
  30. <server>
  31. http
  32. </server>
  33. <name>
  34. HTTP no Location: on second URL 'redirect_url' check
  35. </name>
  36. <command>
  37. http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER0002 -w '%{redirect_url}\n'
  38. </command>
  39. </client>
  40. # Verify data after the test has been "shot"
  41. <verify>
  42. <protocol>
  43. GET /we/want/our/%TESTNUMBER HTTP/1.1
  44. Host: %HOSTIP:%HTTPPORT
  45. User-Agent: curl/%VERSION
  46. Accept: */*
  47. GET /we/want/our/%TESTNUMBER0002 HTTP/1.1
  48. Host: %HOSTIP:%HTTPPORT
  49. User-Agent: curl/%VERSION
  50. Accept: */*
  51. </protocol>
  52. <stdout>
  53. HTTP/1.1 301 This is a weirdo text message swsclose
  54. Location: data/%TESTNUMBER0099.txt?coolsite=yes
  55. Content-Length: 62
  56. Connection: close
  57. This server reply is for testing a simple Location: following
  58. http://%HOSTIP:%HTTPPORT/we/want/our/data/%TESTNUMBER0099.txt?coolsite=yes
  59. HTTP/1.1 200 Followed here fine swsclose
  60. Date: Tue, 09 Nov 2010 14:49:00 GMT
  61. Server: test-server/fake
  62. Content-Length: 41
  63. This second URL does not have a location
  64. </stdout>
  65. </verify>
  66. </testcase>