test318 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP proxy
  6. HTTP Basic auth
  7. HTTP proxy Basic auth
  8. followlocation
  9. </keywords>
  10. </info>
  11. #
  12. # Server-side
  13. <reply>
  14. <data>
  15. HTTP/1.1 302 OK
  16. Date: Tue, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake swsclose
  18. Content-Type: text/html
  19. Funny-head: yesyes
  20. Location: http://goto.second.host.now/%TESTNUMBER0002
  21. Content-Length: 8
  22. Connection: close
  23. contents
  24. </data>
  25. <data2>
  26. HTTP/1.1 200 OK
  27. Date: Tue, 09 Nov 2010 14:49:00 GMT
  28. Server: test-server/fake swsclose
  29. Content-Type: text/html
  30. Funny-head: yesyes
  31. Content-Length: 9
  32. contents
  33. </data2>
  34. <datacheck>
  35. HTTP/1.1 302 OK
  36. Date: Tue, 09 Nov 2010 14:49:00 GMT
  37. Server: test-server/fake swsclose
  38. Content-Type: text/html
  39. Funny-head: yesyes
  40. Location: http://goto.second.host.now/%TESTNUMBER0002
  41. Content-Length: 8
  42. Connection: close
  43. HTTP/1.1 200 OK
  44. Date: Tue, 09 Nov 2010 14:49:00 GMT
  45. Server: test-server/fake swsclose
  46. Content-Type: text/html
  47. Funny-head: yesyes
  48. Content-Length: 9
  49. contents
  50. </datacheck>
  51. </reply>
  52. #
  53. # Client-side
  54. <client>
  55. <server>
  56. http
  57. </server>
  58. <name>
  59. HTTP with custom Authorization: and redirect to new host
  60. </name>
  61. <command>
  62. http://first.host.it.is/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT -H "Authorization: s3cr3t" --proxy-user testing:this --location-trusted
  63. </command>
  64. <features>
  65. proxy
  66. </features>
  67. </client>
  68. #
  69. # Verify data after the test has been "shot"
  70. <verify>
  71. <protocol>
  72. GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1
  73. Host: first.host.it.is
  74. Proxy-Authorization: Basic dGVzdGluZzp0aGlz
  75. User-Agent: curl/%VERSION
  76. Accept: */*
  77. Proxy-Connection: Keep-Alive
  78. Authorization: s3cr3t
  79. GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1
  80. Host: goto.second.host.now
  81. Proxy-Authorization: Basic dGVzdGluZzp0aGlz
  82. User-Agent: curl/%VERSION
  83. Accept: */*
  84. Proxy-Connection: Keep-Alive
  85. Authorization: s3cr3t
  86. </protocol>
  87. </verify>
  88. </testcase>