Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCK for servlet 6.1 servlet/tck/spec/serverpush /ServerPushTests#serverPushCookieTest #661

Open
janbartel opened this issue Jun 20, 2024 · 1 comment

Comments

@janbartel
Copy link
Contributor

https://github.com/jakartaee/servlet/blame/6.1.x/tck/tck-runtime/src/main/java/servlet/tck/spec/serverpush/ServerPushTests.java#L338

This line says that if a cookie with Max-Age <= 0 was added on the server side, a subsequently created PushBuilder should not contain the corresponding Cookie. However, a value of Max-Age=0 indicates to a User-Agent that it should immediately delete a Cookie, but a value of -1 indicates that the Cookie should be considered valid for the duration of the current "session". As the "session" is still clearly ongoing at the point at which the PushBuilder is created, then it should contain the Cookie with Max-Age=-1. Should this test be testing a value of Max-Age=0 instead?

@markt-asf
Copy link
Contributor

While I think there is a case to be made for the behaviour you describe, the Javadoc for PushBuilder has the same language

If HttpServletResponse.addCookie(Cookie) has been called on the associated response, then a corresponding Cookie header will be added to the PushBuilder, unless the Cookie.getMaxAge() is<=0, in which case the Cookie will be removed from the builder.

Therefore, I think the current 6.1 TCK code is correct.

Whether we want to address this for Servlet 6.2 is TBD. PushBuilder is already deprecated and is rarely used. There are also backwards compatibility issues. I'm not sure there is much benefit to changing this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants