test1088 2.2 KB

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