diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-01-18 15:43:36 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-01-18 15:43:36 +0000 |
commit | ae22ff04415c2ef05d9fc73d4eb2243478640c81 (patch) | |
tree | afd2ef9a62527aa7c855e2ff8c8d10a3652ec222 | |
parent | Helper for testing for HTTPS (diff) | |
download | icespider-ae22ff04415c2ef05d9fc73d4eb2243478640c81.tar.bz2 icespider-ae22ff04415c2ef05d9fc73d4eb2243478640c81.tar.xz icespider-ae22ff04415c2ef05d9fc73d4eb2243478640c81.zip |
Set samesite=strict on cookies
-rw-r--r-- | icespider/core/ihttpRequest.cpp | 1 | ||||
-rw-r--r-- | icespider/unittests/testFcgi.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp index 13fc447..bb0b7af 100644 --- a/icespider/core/ihttpRequest.cpp +++ b/icespider/core/ihttpRequest.cpp @@ -153,6 +153,7 @@ namespace IceSpider { if (s){ "; secure"_fmt(o); } + "; samesite=strict"_fmt(o); setHeader(H::SET_COOKIE, o.str()); } diff --git a/icespider/unittests/testFcgi.cpp b/icespider/unittests/testFcgi.cpp index c7b239e..d8c1b0f 100644 --- a/icespider/unittests/testFcgi.cpp +++ b/icespider/unittests/testFcgi.cpp @@ -377,7 +377,7 @@ BOOST_AUTO_TEST_CASE( cookies ) BOOST_REQUIRE_EQUAL("Something with spaces.", *r.IceSpider::IHttpRequest::getCookieParam<std::string>("value B")); BOOST_REQUIRE(!r.IceSpider::IHttpRequest::getCookieParam<Ice::Int>("notAThing")); r.setCookie("some int.", 1234, "www.com"s, "/dir"s, true, 1476142378); - BOOST_REQUIRE_EQUAL("Set-Cookie: some+int%2e=1234; expires=Mon, 10 Oct 2016 23:32:58 GMT; domain=www.com; path=/dir; secure\r\n", r.out.str()); + BOOST_REQUIRE_EQUAL("Set-Cookie: some+int%2e=1234; expires=Mon, 10 Oct 2016 23:32:58 GMT; domain=www.com; path=/dir; secure; samesite=strict\r\n", r.out.str()); } BOOST_AUTO_TEST_CASE( response ) |