-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Added text_mime_types argument #277
Conversation
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.
Thanks @georgebv! Just a few requests related to how the configuration and default are organized now.
The original intention of the LambdaConfig
was for things like this to avoid having to pass things explicitly to the handler __call__
methods.
Also, could you add one new test demonstrating the new configuration being used?
Regarding new tests, I wasn't sure where to put this. Technically, this is an integration test where we use adapter itself. But, since handlers are so different, I put the test to API gateway. |
Yep that’s fine, thank you. |
Hi @georgebv, are you still interested in working on this feature? |
@jordaneremieff absolutely, didn't have time these last 2 weeks - was planning to wrap this up in the next few days |
I had to bring back the |
Yep, that's fine then, thanks for explaining. |
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.
Looks good, great work!
* added vscode files to gitignore * added text_mime_types argument * updated text mime type definition and propagation * copy default text mime types inside mangum * api gateway test * moved instance attributes to config * added tests for custom text mime types
Added optional
text_mime_types
argument to:Mangum
adapter's__init__
methodhandle_base64_response_body
function (this function is the target recipient of thetext_mime_types
list)This argument is optional and by default references the same
DEFAULT_TEXT_MIME_TYPES
list.WARNING: old solutions involving editing the
DEFAULT_TEXT_MIME_TYPES
list are now broken because this list was moved frommangum/handlers/utils.py
tomangum/adapter.py
.resolves #275