-
Notifications
You must be signed in to change notification settings - Fork 434
feat(event_handler): support to enable or disable compression in custom responses #2544
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
feat(event_handler): support to enable or disable compression in custom responses #2544
Conversation
looking |
quick comment: Update the example not to send stacktrace to prevent data leak; log the stack trace instead, and return another message instead back to the client. |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #2544 +/- ##
========================================
Coverage 97.19% 97.20%
========================================
Files 158 158
Lines 7348 7358 +10
Branches 531 534 +3
========================================
+ Hits 7142 7152 +10
Misses 159 159
Partials 47 47
☔ View full report in Codecov by Sentry. |
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.
This is great!! Only one major change to reduce cognitive overload and make it easier to extend new functionalities later.
…om responses (aws-powertools#2544) * feature: adding Response compress parameter * feature: addressing Heitor's feedback * feature: addressing Heitor's feedback * refactor(event_handler): make _has_compression_enabled standalone --------- Co-authored-by: Heitor Lessa <lessa@amazon.co.uk>
Issue number: #2513
Summary
Changes
Use case: Customers use the
exception_handler
decorator to handle 4xx/5xx errors. They might want to encode non-2xx responses.This pull request improve the
Response
class with a newcompress
parameter to override compression setting defined in the route.User experience
BEFORE
AFTER
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
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.