flask-lambda icon indicating copy to clipboard operation
flask-lambda copied to clipboard

fix potential none reference and truncated response body when loading static files

Open snowbldr opened this issue 4 years ago • 0 comments

When clicking the test button in api gateway image

I get an error image

I logged out the event as json and found that headers was null image

This commit adds a guard for if the headers is null, in addition initializes a few keys in the environ to an empty string to prevent key errors.

I also experience and error where all of the responses were truncated to only the first 8192 bytes when sending a static file. This is because the wsgi_app returns and iterator with an 8192k buffer, so the iterator must be exhausted to get the entire body.

snowbldr avatar Jan 04 '21 23:01 snowbldr