-
Notifications
You must be signed in to change notification settings - Fork 34
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
Properly remove cookie header #166
Conversation
Status for workflow
|
if(val.startsWith(cookie.getKey() + "=")) { | ||
it.remove(); | ||
} | ||
List<String> newValues = new ArrayList<>(existing.size()); |
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.
Are you sure existing
cannot be null
?
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.
According to the docs, it can never be null
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.
I also checked all the implementation and saw that they always return an empty list if the name does not exist
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.
The old code was more defensive.
} | ||
this.headers.set(HttpHeaderNames.COOKIE, newValues); |
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.
Does it erase the older value or suffix it (headers are multimap), I believe set
erase, so it would work, but it needs to be checked.
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.
Sets a header with the specified name and values. If there is an existing header with the same name, it is removed. This getMethod can be represented approximately as the following code:
headers.remove(name);
for (Object v: values) {
if (v == null) {
break;
}
headers. add(name, v);
}
I assume we'll need a release of this soon :) |
@cescoffier I will go ahead and (try to) do a release if that's okay with you. |
@geoand maybe I am not putting the pieces together but this looks like Vert.X Servlet and I don't see Undertow anywhere in here?
|
Nevermind I see the classes are |
👌 |
Relates to: quarkusio/quarkus#43628