test1067 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. followlocation
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 301 This is a weirdo text message swsclose
  13. Date: Tue, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake
  15. Location: data/%TESTNUMBER0002.txt?coolsite=yes
  16. Connection: close
  17. This server reply is for testing a simple Location: following
  18. </data>
  19. <data2>
  20. HTTP/1.1 200 Followed here fine swsclose
  21. Date: Tue, 09 Nov 2010 14:49:00 GMT
  22. Server: test-server/fake
  23. Content-Length: 52
  24. If this is received, the location following worked
  25. </data2>
  26. <datacheck>
  27. HTTP/1.1 301 This is a weirdo text message swsclose
  28. Date: Tue, 09 Nov 2010 14:49:00 GMT
  29. Server: test-server/fake
  30. Location: data/%TESTNUMBER0002.txt?coolsite=yes
  31. Connection: close
  32. HTTP/1.1 200 Followed here fine swsclose
  33. Date: Tue, 09 Nov 2010 14:49:00 GMT
  34. Server: test-server/fake
  35. Content-Length: 52
  36. If this is received, the location following worked
  37. </datacheck>
  38. </reply>
  39. # Client-side
  40. <client>
  41. <server>
  42. http
  43. </server>
  44. <name>
  45. HTTP Location: following with auto-referer
  46. </name>
  47. <command>
  48. http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER --silent --location --referer "firstone.html;auto" --write-out "%{stderr}|%{referer}|"
  49. </command>
  50. </client>
  51. # Verify data after the test has been "shot"
  52. <verify>
  53. <protocol>
  54. GET /want/%TESTNUMBER HTTP/1.1
  55. Host: %HOSTIP:%HTTPPORT
  56. User-Agent: curl/%VERSION
  57. Accept: */*
  58. Referer: firstone.html
  59. GET /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1
  60. Host: %HOSTIP:%HTTPPORT
  61. User-Agent: curl/%VERSION
  62. Accept: */*
  63. Referer: http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER
  64. </protocol>
  65. <stderr nonewline="yes">
  66. |http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER|
  67. </stderr>
  68. </verify>
  69. </testcase>