feat(event_handler): support to enable or disable compression in custom responses - #2544
feat(event_handler): support to enable or disable compression in custom responses#2544leandrodamascena merged 6 commits into
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. |
heitorlessa
left a comment
There was a problem hiding this comment.
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_handlerdecorator to handle 4xx/5xx errors. They might want to encode non-2xx responses.This pull request improve the
Responseclass with a newcompressparameter 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.