Added text_mime_types argument#277
Added text_mime_types argument#277jordaneremieff merged 7 commits intoKludex:mainfrom georgebv:mime-types-arg
Conversation
jordaneremieff
left a comment
There was a problem hiding this comment.
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. |
jordaneremieff
left a comment
There was a problem hiding this comment.
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_typesargument to:Mangumadapter's__init__methodhandle_base64_response_bodyfunction (this function is the target recipient of thetext_mime_typeslist)This argument is optional and by default references the same
DEFAULT_TEXT_MIME_TYPESlist.WARNING: old solutions involving editing the
DEFAULT_TEXT_MIME_TYPESlist are now broken because this list was moved frommangum/handlers/utils.pytomangum/adapter.py.resolves #275