test1087 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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: Tue, 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/%TESTNUMBER1002
  28. Content-Length: 0
  29. Connection: close
  30. </data1001>
  31. <data1002 nocheck="yes">
  32. HTTP/1.1 200 OK
  33. Date: Tue, 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: Tue, 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/%TESTNUMBER1002
  51. Content-Length: 0
  52. Connection: close
  53. HTTP/1.1 200 OK
  54. Date: Tue, 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/%TESTNUMBER1000 -x %HOSTIP:%HTTPPORT --user iam:myself --location --anyauth
  73. </command>
  74. <features>
  75. proxy
  76. </features>
  77. </client>
  78. #
  79. # Verify data after the test has been "shot"
  80. <verify>
  81. <protocol>
  82. GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1
  83. Host: first.host.it.is
  84. User-Agent: curl/%VERSION
  85. Accept: */*
  86. Proxy-Connection: Keep-Alive
  87. GET http://first.host.it.is/we/want/that/page/%TESTNUMBER1000 HTTP/1.1
  88. Host: first.host.it.is
  89. Authorization: Basic aWFtOm15c2VsZg==
  90. User-Agent: curl/%VERSION
  91. Accept: */*
  92. Proxy-Connection: Keep-Alive
  93. GET http://goto.second.host.now/%TESTNUMBER1002 HTTP/1.1
  94. Host: goto.second.host.now
  95. User-Agent: curl/%VERSION
  96. Accept: */*
  97. Proxy-Connection: Keep-Alive
  98. </protocol>
  99. </verify>
  100. </testcase>