2
0

test309 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTPS
  6. HTTP GET
  7. followlocation
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 301 This is a weirdo text message swsclose
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes
  17. Connection: close
  18. This server reply is for testing a simple Location: following to HTTPS URL
  19. </data>
  20. <data2>
  21. HTTP/1.1 200 Followed here fine swsclose
  22. Date: Thu, 09 Nov 2010 14:49:00 GMT
  23. Server: test-server/fake
  24. Content-Length: 52
  25. If this is received, the location following worked
  26. </data2>
  27. <datacheck>
  28. HTTP/1.1 301 This is a weirdo text message swsclose
  29. Date: Thu, 09 Nov 2010 14:49:00 GMT
  30. Server: test-server/fake
  31. Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes
  32. Connection: close
  33. HTTP/1.1 200 Followed here fine swsclose
  34. Date: Thu, 09 Nov 2010 14:49:00 GMT
  35. Server: test-server/fake
  36. Content-Length: 52
  37. If this is received, the location following worked
  38. </datacheck>
  39. </reply>
  40. # Client-side
  41. <client>
  42. <features>
  43. SSL
  44. </features>
  45. <server>
  46. http
  47. https
  48. </server>
  49. <name>
  50. HTTP Location: redirect to HTTPS URL
  51. </name>
  52. <command>
  53. -k http://%HOSTIP:%HTTPPORT/want/309 -L
  54. </command>
  55. # The data section doesn't do variable substitution, so we must assert this
  56. <precheck>
  57. perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%HTTPSPORT' ne '8991' );"
  58. </precheck>
  59. </client>
  60. # Verify data after the test has been "shot"
  61. <verify>
  62. <strip>
  63. ^User-Agent:.*
  64. </strip>
  65. <protocol>
  66. GET /want/309 HTTP/1.1
  67. Host: %HOSTIP:%HTTPPORT
  68. Accept: */*
  69. GET /data/3090002.txt?coolsite=yes HTTP/1.1
  70. Host: %HOSTIP:%HTTPSPORT
  71. Accept: */*
  72. </protocol>
  73. </verify>
  74. </testcase>