From a52e46f3900fb02fd45423c35d970703978fe6ff Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 22 Nov 2018 13:24:02 +0100 Subject: cookies: create the cookiejar even if no cookies to save Important for when the file is going to be read again and thus must not contain old contents! Adds test 327 to verify. Reported-by: daboul on github Fixes #3299 Closes #3300 --- tests/data/test327 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 tests/data/test327 (limited to 'tests/data/test327') diff --git a/tests/data/test327 b/tests/data/test327 new file mode 100644 index 000000000..fcb98990f --- /dev/null +++ b/tests/data/test327 @@ -0,0 +1,73 @@ + + + +HTTP +HTTP GET +cookies +header dump + + + +# This test verifies that the cookie file gets created even if the last cookie +# has been removed - particularly important when the file is going to be read +# again and thus must not contain old contents. + +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes swsclose +Set-Cookie: foobar=name; expires=Thu, 22 Nov 2028 10:54:11 GMT; + + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes swsclose +Set-Cookie: foobar=name; expires=Thu, 01 Jan 1970 00:00:00 GMT; + + + + +# Client-side + + +http + + +HTTP with cookiejar without cookies left + + +http://%HOSTIP:%HTTPPORT/we/want/327 -b none -c log/cookies327 http://%HOSTIP:%HTTPPORT/we/want/3270002 + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /we/want/327 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /we/want/3270002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Cookie: foobar=name + + + +# Netscape HTTP Cookie File +# https://curl.haxx.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + + + + -- cgit v1.2.3