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

fix(event_handler): make the max_age attribute comply with RFC specification #4731

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

leandrodamascena
Copy link
Contributor

Issue number: #4730

Summary

Changes

This PR fixes the cookie handling based on RFC6265 by ensuring the Max-Age field is hyphenated (Max-Age).

User experience

from aws_lambda_powertools.shared.cookies import Cookie
from aws_lambda_powertools.event_handler import Response
cookie = Cookie(name="Test", value="Test", max_age=60)
str(cookie)
>>> 'Test=Test; Max-Age=60; Secure'

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@leandrodamascena leandrodamascena requested a review from a team as a code owner July 10, 2024 18:05
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 10, 2024
@github-actions github-actions bot added the bug Something isn't working label Jul 10, 2024
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (10d551c) to head (19b2b5a).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4731      +/-   ##
===========================================
+ Coverage    96.43%   96.60%   +0.17%     
===========================================
  Files          223      223              
  Lines        10757    10757              
  Branches      2001     2001              
===========================================
+ Hits         10373    10392      +19     
+ Misses         270      259      -11     
+ Partials       114      106       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leandrodamascena leandrodamascena changed the title fix(event_handler): make max_age attribute to follow the RFC fix(event_handler): make the max_age attribute comply with RFC specification Jul 10, 2024
@leandrodamascena leandrodamascena requested a review from sthulb July 11, 2024 07:24
@sthulb sthulb merged commit 3ae2eec into aws-powertools:develop Jul 11, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working commons size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cookie class MaxAge produces invalid attribute, resulting to browser defaulting to session.
2 participants