test898 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP proxy
  6. --location
  7. Authorization
  8. Cookie
  9. </keywords>
  10. </info>
  11. #
  12. # Server-side
  13. <reply>
  14. <data>
  15. HTTP/1.1 301 redirect
  16. Date: Tue, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake
  18. Content-Length: 0
  19. Connection: close
  20. Content-Type: text/html
  21. Location: http://firsthost.com:9999/a/path/%TESTNUMBER0002
  22. </data>
  23. <data2>
  24. HTTP/1.1 200 OK
  25. Date: Tue, 09 Nov 2010 14:49:00 GMT
  26. Server: test-server/fake
  27. Content-Length: 4
  28. Connection: close
  29. Content-Type: text/html
  30. hey
  31. </data2>
  32. <datacheck>
  33. HTTP/1.1 301 redirect
  34. Date: Tue, 09 Nov 2010 14:49:00 GMT
  35. Server: test-server/fake
  36. Content-Length: 0
  37. Connection: close
  38. Content-Type: text/html
  39. Location: http://firsthost.com:9999/a/path/%TESTNUMBER0002
  40. HTTP/1.1 200 OK
  41. Date: Tue, 09 Nov 2010 14:49:00 GMT
  42. Server: test-server/fake
  43. Content-Length: 4
  44. Connection: close
  45. Content-Type: text/html
  46. hey
  47. </datacheck>
  48. </reply>
  49. #
  50. # Client-side
  51. <client>
  52. <features>
  53. proxy
  54. </features>
  55. <server>
  56. http
  57. </server>
  58. <name>
  59. HTTP with custom auth and cookies redirected to HTTP on a diff port
  60. </name>
  61. <command>
  62. -x http://%HOSTIP:%HTTPPORT http://firsthost.com -L -H "Authorization: Basic am9lOnNlY3JldA==" -H "Cookie: userpwd=am9lOnNlY3JldA=="
  63. </command>
  64. </client>
  65. #
  66. # Verify data after the test has been "shot"
  67. <verify>
  68. <protocol>
  69. GET http://firsthost.com/ HTTP/1.1
  70. Host: firsthost.com
  71. User-Agent: curl/%VERSION
  72. Accept: */*
  73. Proxy-Connection: Keep-Alive
  74. Authorization: Basic am9lOnNlY3JldA==
  75. Cookie: userpwd=am9lOnNlY3JldA==
  76. GET http://firsthost.com:9999/a/path/%TESTNUMBER0002 HTTP/1.1
  77. Host: firsthost.com:9999
  78. User-Agent: curl/%VERSION
  79. Accept: */*
  80. Proxy-Connection: Keep-Alive
  81. </protocol>
  82. </verify>
  83. </testcase>