test1261 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/10290002.txt?coolsite=yes
  16. Content-Length: 62
  17. Connection: close
  18. This server reply is for testing a simple Location: following
  19. </data>
  20. </reply>
  21. # Client-side
  22. <client>
  23. <server>
  24. http
  25. </server>
  26. <name>
  27. 'redirect_url' with --location and --max-redirs
  28. </name>
  29. <command>
  30. http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -w '%{redirect_url}\n' --location --max-redirs 0
  31. </command>
  32. </client>
  33. # Verify data after the test has been "shot"
  34. <verify>
  35. <protocol>
  36. GET /we/want/our/%TESTNUMBER HTTP/1.1
  37. Host: %HOSTIP:%HTTPPORT
  38. User-Agent: curl/%VERSION
  39. Accept: */*
  40. </protocol>
  41. # CURLE_TOO_MANY_REDIRECTS
  42. <errorcode>
  43. 47
  44. </errorcode>
  45. <stdout>
  46. HTTP/1.1 301 This is a weirdo text message swsclose
  47. Location: data/10290002.txt?coolsite=yes
  48. Content-Length: 62
  49. Connection: close
  50. http://%HOSTIP:%HTTPPORT/we/want/our/data/10290002.txt?coolsite=yes
  51. </stdout>
  52. </verify>
  53. </testcase>