test327 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. cookies
  7. header dump
  8. </keywords>
  9. </info>
  10. # This test verifies that the cookie file gets created even if the last cookie
  11. # has been removed - particularly important when the file is going to be read
  12. # again and thus must not contain old contents.
  13. # Server-side
  14. <reply>
  15. <data>
  16. HTTP/1.1 200 OK
  17. Date: Tue, 09 Nov 2010 14:49:00 GMT
  18. Server: test-server/fake
  19. Content-Type: text/html
  20. Funny-head: yesyes swsclose
  21. Set-Cookie: foobar=name; expires=Thu, 22 Nov 2525 10:54:11 GMT;
  22. </data>
  23. <data2>
  24. HTTP/1.1 200 OK
  25. Date: Tue, 09 Nov 2010 14:49:00 GMT
  26. Server: test-server/fake
  27. Content-Type: text/html
  28. Funny-head: yesyes swsclose
  29. Set-Cookie: foobar=name; expires=Thu, 01 Jan 1970 00:00:00 GMT;
  30. </data2>
  31. </reply>
  32. # Client-side
  33. <client>
  34. <server>
  35. http
  36. </server>
  37. <name>
  38. HTTP with cookiejar without cookies left
  39. </name>
  40. <command>
  41. http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b none -c %LOGDIR/cookies%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER0002
  42. </command>
  43. <features>
  44. cookies
  45. </features>
  46. </client>
  47. # Verify data after the test has been "shot"
  48. <verify>
  49. <protocol>
  50. GET /we/want/%TESTNUMBER HTTP/1.1
  51. Host: %HOSTIP:%HTTPPORT
  52. User-Agent: curl/%VERSION
  53. Accept: */*
  54. GET /we/want/%TESTNUMBER0002 HTTP/1.1
  55. Host: %HOSTIP:%HTTPPORT
  56. User-Agent: curl/%VERSION
  57. Accept: */*
  58. Cookie: foobar=name
  59. </protocol>
  60. <file name="%LOGDIR/cookies%TESTNUMBER" mode="text">
  61. # Netscape HTTP Cookie File
  62. # https://curl.se/docs/http-cookies.html
  63. # This file was generated by libcurl! Edit at your own risk.
  64. </file>
  65. </verify>
  66. </testcase>