Update Test.java

This commit is contained in:
Mauro Baluda
2022-12-02 18:01:10 +01:00
committed by GitHub
parent f3f8f35069
commit 04f1fe523a

View File

@@ -84,5 +84,15 @@ class Test {
response.addCookie(cookie);
}
{
// GOOD: set secure flag in call to `createSecureCookie`
response.addCookie(createSecureCookie());
}
}
private static Cookie createSecureCookie() {
Cookie cookie = new Cookie("secret", "fakesecret");
cookie.setSecure(constTrue);
return cookie;
}
}