test61 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: Tue, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake
  18. Content-Type: text/html
  19. Funny-head: yesyes
  20. %if large-time
  21. Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2525
  22. SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2525
  23. %else
  24. Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2037
  25. SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2037
  26. %endif
  27. Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure
  28. Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure
  29. Set-Cookie: test5=name; domain=anything.com; path=/ ; secure
  30. Set-Cookie: fake=fooledyou; domain=..com; path=/;
  31. Set-Cookie: supercookie=fooledyou; domain=.com; path=/;
  32. Content-Length: 4
  33. boo
  34. </data>
  35. </reply>
  36. # Client-side
  37. <client>
  38. <server>
  39. http
  40. </server>
  41. <name>
  42. HTTP with various cookies and custom Host:
  43. </name>
  44. # Explicitly set the time zone to a known good one, in case the user is
  45. # using one of the 'right' zones that take into account leap seconds
  46. # which causes the cookie expiry times to be different.
  47. <setenv>
  48. TZ=GMT
  49. </setenv>
  50. <command>
  51. http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -c %LOGDIR/jar%TESTNUMBER.txt -H "Host: www.host.foo.com"
  52. </command>
  53. <features>
  54. cookies
  55. </features>
  56. </client>
  57. # Verify data after the test has been "shot"
  58. <verify>
  59. <protocol>
  60. GET /we/want/%TESTNUMBER HTTP/1.1
  61. Host: www.host.foo.com
  62. User-Agent: curl/%VERSION
  63. Accept: */*
  64. </protocol>
  65. <file name="%LOGDIR/jar%TESTNUMBER.txt" mode="text">
  66. # Netscape HTTP Cookie File
  67. # https://curl.se/docs/http-cookies.html
  68. # This file was generated by libcurl! Edit at your own risk.
  69. %if large-time
  70. .host.foo.com TRUE /we/want/ FALSE 17517902187 test2 yes
  71. #HttpOnly_.foo.com TRUE /we/want/ FALSE 17517902187 test yes
  72. %else
  73. .host.foo.com TRUE /we/want/ FALSE 2118138987 test2 yes
  74. #HttpOnly_.foo.com TRUE /we/want/ FALSE 2118138987 test yes
  75. %endif
  76. </file>
  77. </verify>
  78. </testcase>