test318 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: Thu, 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/3180002
  21. Content-Length: 8
  22. Connection: close
  23. contents
  24. </data>
  25. <data2>
  26. HTTP/1.1 200 OK
  27. Date: Thu, 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: Thu, 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/3180002
  41. Content-Length: 8
  42. Connection: close
  43. HTTP/1.1 200 OK
  44. Date: Thu, 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/318 -x %HOSTIP:%HTTPPORT -H "Authorization: s3cr3t" --proxy-user testing:this --location-trusted
  63. </command>
  64. </client>
  65. #
  66. # Verify data after the test has been "shot"
  67. <verify>
  68. <strip>
  69. ^User-Agent:.*
  70. </strip>
  71. <protocol>
  72. GET http://first.host.it.is/we/want/that/page/318 HTTP/1.1
  73. Host: first.host.it.is
  74. Proxy-Authorization: Basic dGVzdGluZzp0aGlz
  75. Accept: */*
  76. Proxy-Connection: Keep-Alive
  77. Authorization: s3cr3t
  78. GET http://goto.second.host.now/3180002 HTTP/1.1
  79. Host: goto.second.host.now
  80. Proxy-Authorization: Basic dGVzdGluZzp0aGlz
  81. Accept: */*
  82. Proxy-Connection: Keep-Alive
  83. Authorization: s3cr3t
  84. </protocol>
  85. </verify>
  86. </testcase>