jakartaee / rest

Jakarta RESTful Web Services
Other
351 stars 114 forks source link

current "SameSite" attribute values generating error #1194

Open dabbabi opened 7 months ago

dabbabi commented 7 months ago

Greetings, I would like to report an issue related to the values of the SameSite attribute impacting the behavior of our Jakartaee applications. Based on draft-ietf-httpbis-rfc6265bis-13 (which should obsoletes RFC 6265 if approved, values of samesite-value are None, Lax and Strict). Currently browsers can't interpret the value of this flag and return a warning saying that it does not have a proper "SameSite" attribute value. Soon, this behavior will change (as mentioned in Mozilla). Is it possible, please, in jakarta.ws.rs.core.NewCookie class, to substitute

public enum SameSite {
   NONE,
   LAX,
   STRICT
}

by

public enum SameSite {
   None,
   Lax,
   Strict
}

Otherwise, I'm sure that you've a better solution. Thank you

NicoNes commented 7 months ago

Hey @dabbabi,

Well enum are constants so that's why the names of an enum type's fields are in uppercase letters.

I think the change must be done in the jakarta.ws.rs.ext.RuntimeDelegate.HeaderDelegate<NewCookie> implementation provided by your JAKARTA-RS provider (such as RESTEasy for example). Its the job of this jakarta.ws.rs.ext.RuntimeDelegate.HeaderDelegate<NewCookie> implementation to convert a NewCookie instance into a String form of an HTTP header.

-- Nicolas