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

Review HTTP Cookie parsing #10219

Closed
sbordet opened this issue Aug 3, 2023 · 2 comments · Fixed by #10464
Closed

Review HTTP Cookie parsing #10219

sbordet opened this issue Aug 3, 2023 · 2 comments · Fixed by #10464
Assignees
Labels
Bug For general bugs on Jetty side High Priority

Comments

@sbordet
Copy link
Contributor

sbordet commented Aug 3, 2023

Jetty version(s)
12

Description
HttpClient has a hacky implementation of parsing Set-Cookie to create o.e.j.http.HttpCookie instances.
HttpCookieUtils is on jetty-server but has a method to parse Set-Cookie (which would be needed by clients), also hacky and current unused.
CometD has the same need of parsing Set-Cookie headers, and also has a hacky implementation.

A proper Set-Cookie parser should be implemented, and be part of jetty-http so that it can be used by clients (and possibly servers if needed).

@sbordet sbordet added the Bug For general bugs on Jetty side label Aug 3, 2023
@sbordet sbordet self-assigned this Aug 3, 2023
@sbordet
Copy link
Contributor Author

sbordet commented Aug 3, 2023

Also, IPv6 domains should be supported, at least [::1] for testing.
See also #9665.

@sbordet sbordet moved this to 🏗 In progress in Jetty 12.0.2 FROZEN Aug 31, 2023
sbordet added a commit that referenced this issue Sep 1, 2023
* Added HttpCookie.parse() to properly parse Set-Cookie values.
* Removed hacky implementation in HttpClient.
* Removed unused methods in HttpCookieUtils.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet linked a pull request Sep 1, 2023 that will close this issue
sbordet added a commit that referenced this issue Sep 14, 2023
* Added SetCookieParser interface and RFC6265SetCookieParser implementation to properly parse Set-Cookie values.
* Removed hacky implementation in HttpClient.
* Removed unused methods in HttpCookieUtils.
* Using SetCookieParser for the implementation of newPushBuilder in ee9,ee10.
* Reworked HttpCookieStore.Default implementation.
* Implemented properly cookie path resolution.
* Using URI.getRawPath() to resolve cookie paths.
* Removed secure vs. non-secure scheme distinction when storing cookies.
* Refactored common code in HttpCookieStore.Default to avoid duplications.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet
Copy link
Contributor Author

sbordet commented Sep 14, 2023

Fixed by #10464.

@sbordet sbordet closed this as completed Sep 14, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Jetty 12.0.2 FROZEN Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant