test1087 2.1 KB

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