test61 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. cookies
  7. cookiejar
  8. HTTP replaced headers
  9. httponly
  10. </keywords>
  11. </info>
  12. # Server-side
  13. <reply>
  14. <data>
  15. HTTP/1.1 200 OK
  16. Date: Thu, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake
  18. Content-Type: text/html
  19. Funny-head: yesyes
  20. Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 2 11:56:27 GMT 2035
  21. SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 2 11:56:27 GMT 2035
  22. Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure
  23. Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure
  24. Set-Cookie: test5=name; domain=anything.com; path=/ ; secure
  25. Set-Cookie: fake=fooledyou; domain=..com; path=/;
  26. Set-Cookie: supercookie=fooledyou; domain=.com; path=/;^M
  27. Content-Length: 4
  28. boo
  29. </data>
  30. </reply>
  31. # Client-side
  32. <client>
  33. <server>
  34. http
  35. </server>
  36. <name>
  37. HTTP with various cookies and custom Host:
  38. </name>
  39. # Explicitly set the time zone to a known good one, in case the user is
  40. # using one of the 'right' zones that take into account leap seconds
  41. # which causes the cookie expiry times to be different.
  42. <setenv>
  43. TZ=GMT
  44. </setenv>
  45. <command>
  46. http://%HOSTIP:%HTTPPORT/we/want/61 -c log/jar61.txt -H "Host: www.host.foo.com"
  47. </command>
  48. </client>
  49. # Verify data after the test has been "shot"
  50. <verify>
  51. <strip>
  52. ^User-Agent:.*
  53. </strip>
  54. <protocol>
  55. GET /we/want/61 HTTP/1.1
  56. Host: www.host.foo.com
  57. Accept: */*
  58. </protocol>
  59. <file name="log/jar61.txt" mode="text">
  60. # Netscape HTTP Cookie File
  61. # https://curl.haxx.se/docs/http-cookies.html
  62. # This file was generated by libcurl! Edit at your own risk.
  63. .foo.com TRUE /moo TRUE 0 test3 maybe
  64. .host.foo.com TRUE /we/want/ FALSE 2054030187 test2 yes
  65. #HttpOnly_.foo.com TRUE /we/want/ FALSE 2054030187 test yes
  66. </file>
  67. </verify>
  68. </testcase>