test327 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 2037 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 log/cookies%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER0002
  42. </command>
  43. </client>
  44. # Verify data after the test has been "shot"
  45. <verify>
  46. <protocol>
  47. GET /we/want/%TESTNUMBER HTTP/1.1
  48. Host: %HOSTIP:%HTTPPORT
  49. User-Agent: curl/%VERSION
  50. Accept: */*
  51. GET /we/want/%TESTNUMBER0002 HTTP/1.1
  52. Host: %HOSTIP:%HTTPPORT
  53. User-Agent: curl/%VERSION
  54. Accept: */*
  55. Cookie: foobar=name
  56. </protocol>
  57. <file name="log/cookies%TESTNUMBER" mode="text">
  58. # Netscape HTTP Cookie File
  59. # https://curl.se/docs/http-cookies.html
  60. # This file was generated by libcurl! Edit at your own risk.
  61. </file>
  62. </verify>
  63. </testcase>