-
Bug
-
Resolution: Done
-
Major
-
6.2.5.Final
-
None
The following test fails with RestEasy:
@Test public void testCookie_Serialization() { var newCookie = new NewCookie.Builder("testcookie") .value("hello") .path("/") .version(1) .maxAge(-1) .secure(true) .httpOnly(true) .sameSite(NewCookie.SameSite.STRICT) .build(); String serializedCookie = RuntimeDelegate.getInstance().createHeaderDelegate(NewCookie.class).toString(newCookie); assertTrue(String.format("serialized cookie does not contain samesite-attribute: %s", serializedCookie), serializedCookie.toLowerCase().contains("samesite=strict")); }
The error message shows that the same-site attribute is not correctly serialized:
StrictTest.testCookie_Serialization:43 serialized cookie does not contain samesite-attribute: testcookie=hello;Version=1;Path=/;Secure;HttpOnly