test1204 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Basic auth
  7. --anyauth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 401 Authorization Required swsbounce
  14. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  15. WWW-Authenticate: X-MobileMe-AuthToken realm="Newcastle", Basic realm="fun fun fun"
  16. Content-Type: text/html; charset=iso-8859-1
  17. Content-Length: 26
  18. This is not the real page
  19. </data>
  20. # This is supposed to be returned when the server gets the second request
  21. <data1>
  22. HTTP/1.1 200 OK
  23. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  24. Content-Type: text/html; charset=iso-8859-1
  25. Content-Length: 23
  26. This IS the real page!
  27. </data1>
  28. <datacheck>
  29. HTTP/1.1 401 Authorization Required swsbounce
  30. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  31. WWW-Authenticate: X-MobileMe-AuthToken realm="Newcastle", Basic realm="fun fun fun"
  32. Content-Type: text/html; charset=iso-8859-1
  33. Content-Length: 26
  34. HTTP/1.1 200 OK
  35. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  36. Content-Type: text/html; charset=iso-8859-1
  37. Content-Length: 23
  38. This IS the real page!
  39. </datacheck>
  40. </reply>
  41. # Client-side
  42. <client>
  43. <server>
  44. http
  45. </server>
  46. <name>
  47. HTTP with WWW-Authenticate and multiple auths in a single line
  48. </name>
  49. <command>
  50. http://%HOSTIP:%HTTPPORT/1204 -u testuser:testpass --anyauth
  51. </command>
  52. </client>
  53. # Verify data after the test has been "shot"
  54. <verify>
  55. <strip>
  56. ^User-Agent:.*
  57. </strip>
  58. <protocol>
  59. GET /1204 HTTP/1.1
  60. Host: %HOSTIP:%HTTPPORT
  61. Accept: */*
  62. GET /1204 HTTP/1.1
  63. Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
  64. Host: %HOSTIP:%HTTPPORT
  65. Accept: */*
  66. </protocol>
  67. </verify>
  68. </testcase>