Skip to content

fix: enable response compression when using multi-value headers #6936

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

Conversation

kimsappi
Copy link
Contributor

@kimsappi kimsappi commented Jul 3, 2025

Issue number: #6912

Summary

Changes

Enabled REST response compression to work when multi-value headers are enabled for REST resolvers. Previously only the Lambda invocation event's "headers" field was considered, now "multiValueHeaders" is used when present, relying on generic Powertools functionality (event.resolved_headers_field).

User experience

Previously response compression would not work if the Lambda function integration had multi-value headers enabled. Now it does.

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.

@kimsappi kimsappi requested a review from a team as a code owner July 3, 2025 17:39
@kimsappi kimsappi requested a review from leandrodamascena July 3, 2025 17:39
Copy link

boring-cyborg bot commented Jul 3, 2025

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 3, 2025
@boring-cyborg boring-cyborg bot added the tests label Jul 3, 2025
@kimsappi kimsappi force-pushed the fix-multivalueheaders-compression branch from a02c8f6 to 5645985 Compare July 3, 2025 18:00
Copy link

sonarqubecloud bot commented Jul 3, 2025

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this PR @kimsappi! I read your comment in the issue and I agree.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.20%. Comparing base (1cf03be) to head (5645985).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
aws_lambda_powertools/event_handler/api_gateway.py 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6936      +/-   ##
===========================================
- Coverage    96.21%   96.20%   -0.01%     
===========================================
  Files          273      273              
  Lines        12704    12709       +5     
  Branches       947      949       +2     
===========================================
+ Hits         12223    12227       +4     
  Misses         377      377              
- Partials       104      105       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena leandrodamascena merged commit 3448989 into aws-powertools:develop Jul 3, 2025
10 of 12 checks passed
Copy link

boring-cyborg bot commented Jul 3, 2025

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@github-actions github-actions bot added the bug Something isn't working label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working event_handlers size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: REST response compression does not work when multiValueHeaders are enabled
2 participants