test1088 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP proxy
  6. HTTP Basic auth
  7. HTTP proxy Basic auth
  8. followlocation
  9. --anyauth
  10. --location-trusted
  11. </keywords>
  12. </info>
  13. #
  14. # Server-side
  15. <reply>
  16. <data1000 nocheck="yes">
  17. HTTP/1.1 401 Authorization Required
  18. WWW-Authenticate: Basic
  19. Content-Type: text/plain
  20. Content-Length: 0
  21. </data1000>
  22. <data1001 nocheck="yes">
  23. HTTP/1.1 302 OK
  24. Date: Thu, 09 Nov 2010 14:49:00 GMT
  25. Server: test-server/fake swsclose
  26. Content-Type: text/plain
  27. Funny-head: yesyes
  28. Location: http://goto.second.host.now/10881002
  29. Content-Length: 0
  30. Connection: close
  31. </data1001>
  32. <data1003 nocheck="yes">
  33. HTTP/1.1 200 OK
  34. Date: Thu, 09 Nov 2010 14:49:00 GMT
  35. Server: test-server/fake swsclose
  36. Content-Type: text/plain
  37. Funny-head: yesyes
  38. Content-Length: 9
  39. contents
  40. </data1003>
  41. <datacheck>
  42. HTTP/1.1 401 Authorization Required
  43. WWW-Authenticate: Basic
  44. Content-Type: text/plain
  45. Content-Length: 0
  46. HTTP/1.1 302 OK
  47. Date: Thu, 09 Nov 2010 14:49:00 GMT
  48. Server: test-server/fake swsclose
  49. Content-Type: text/plain
  50. Funny-head: yesyes
  51. Location: http://goto.second.host.now/10881002
  52. Content-Length: 0
  53. Connection: close
  54. HTTP/1.1 200 OK
  55. Date: Thu, 09 Nov 2010 14:49:00 GMT
  56. Server: test-server/fake swsclose
  57. Content-Type: text/plain
  58. Funny-head: yesyes
  59. Content-Length: 9
  60. contents
  61. </datacheck>
  62. </reply>
  63. #
  64. # Client-side
  65. <client>
  66. <server>
  67. http
  68. </server>
  69. <name>
  70. HTTP, proxy with --anyauth and Location: to new host using location-trusted
  71. </name>
  72. <command>
  73. http://first.host.it.is/we/want/that/page/10881000 -x %HOSTIP:%HTTPPORT --user iam:myself --location-trusted --anyauth
  74. </command>
  75. </client>
  76. #
  77. # Verify data after the test has been "shot"
  78. <verify>
  79. <strip>
  80. ^User-Agent:.*
  81. </strip>
  82. <protocol>
  83. GET http://first.host.it.is/we/want/that/page/10881000 HTTP/1.1
  84. Host: first.host.it.is
  85. Accept: */*
  86. Proxy-Connection: Keep-Alive
  87. GET http://first.host.it.is/we/want/that/page/10881000 HTTP/1.1
  88. Host: first.host.it.is
  89. Authorization: Basic aWFtOm15c2VsZg==
  90. Accept: */*
  91. Proxy-Connection: Keep-Alive
  92. GET http://goto.second.host.now/10881002 HTTP/1.1
  93. Host: goto.second.host.now
  94. Authorization: Basic aWFtOm15c2VsZg==
  95. Accept: */*
  96. Proxy-Connection: Keep-Alive
  97. </protocol>
  98. </verify>
  99. </testcase>