-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add support for the SameSite cookie attribute. #607
Conversation
components/api/src/main/java/com/hotels/styx/api/ClientCookieDecoder.java
Show resolved
Hide resolved
* | ||
* @see ClientCookieEncoder | ||
*/ | ||
public final class ClientCookieDecoder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class needs to be package private, ideally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All external references removed and it's package private now (so we are using Netty's original ClientCookieDecoder in some tests).
components/api/src/main/java/com/hotels/styx/api/ClientCookieDecoder.java
Outdated
Show resolved
Hide resolved
@@ -81,7 +77,8 @@ public String encode(String name, String value) { | |||
* @param cookie the cookie | |||
* @return a single Set-Cookie header value | |||
*/ | |||
public String encode(Cookie cookie) { | |||
public String encode(NettyCookie cookie) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could possibly be package private.
@@ -146,7 +147,7 @@ public String encode(Cookie cookie) { | |||
* @param cookies a bunch of cookies | |||
* @return the corresponding bunch of Set-Cookie headers | |||
*/ | |||
public List<String> encode(Cookie... cookies) { | |||
public List<String> encode(NettyCookie... cookies) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be package private too, AFAICS.
@@ -194,20 +195,20 @@ public String encode(Cookie cookie) { | |||
* @param cookies a bunch of cookies | |||
* @return the corresponding bunch of Set-Cookie headers | |||
*/ | |||
public List<String> encode(Iterable<? extends Cookie> cookies) { | |||
Iterator<? extends Cookie> cookiesIt = requireNonNull(cookies, "cookies").iterator(); | |||
public List<String> encode(Iterable<? extends NettyCookie> cookies) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly all these encode
methods could be package private.
|
||
client.send( | ||
get("/") | ||
.header(HttpHeaderNames.HOST, styxServer().proxyHttpHostHeader()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static import.
@@ -286,7 +286,7 @@ class OriginsFileCompatibilitySpec : FunSpec() { | |||
} | |||
} | |||
|
|||
test("!TLS Settings modifications") { | |||
test("TLS Settings modifications") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this disabled.
I wonder if you are interested in contributing something like this back into netty... |
@a-dlatorre I bet you will be looking into this? |
This PR handles issue #604 . Description of the attribute:
https://web.dev/samesite-cookies-explained/