Skip to content

Update cookie handling to align with rfc6265 specifications #1056

New issue

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

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

Already on GitHub? # to your account

Merged
merged 8 commits into from
Oct 8, 2024

Conversation

leekib
Copy link
Contributor

@leekib leekib commented Sep 23, 2024

Issue #, if available: #867

Description of changes:

Refactored the cookie processing logic to comply with RFC 6265 specifications.

  • Introduced CookieProcessor interface and AwsCookieProcessor implementation:
    • Encapsulates cookie parsing and formatting logic according to RFC 6265.
  • Refactored AwsHttpServletResponse and AwsHttpServletRequest:
    • Updated to use the CookieProcessor for all cookie-related operations.
    • Centralized cookie handling logic by removing it from the AWS HTTP classes.
  • Ensured proper handling of cookies with Max-Age=0:
    • Cookies now expire immediately as specified by RFC 6265.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

leekib and others added 6 commits September 22, 2024 15:10
- Created a `CookieProcessor` interface along with its implementation `AwsCookieProcessor` to encapsulate cookie parsing and formatting logic.
- Modified `AwsHttpServletResponse` and `AwsHttpServletRequest` to use the `CookieProcessor` for all cookie-related operations.
- Replaced the usage of `SimpleDateFormat` with `DateTimeFormatter` to ensure thread-safe date formatting.
Copy link
Contributor

@jonife jonife left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leekib leekib requested a review from jonife October 2, 2024 08:41
@leekib
Copy link
Contributor Author

leekib commented Oct 2, 2024

@jonife Sorry, I accidentally re-requested your review. There are no new changes. Thanks!

@jonife jonife merged commit e6abc1f into aws:main Oct 8, 2024
4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants