-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
All responses are base64 encoded #1605
Comments
Worth noting that this encoding bug seemingly makes it impossible to do API Gateway level compression of responses. Perhaps this needs a priority bump? |
This seems like a pretty big bug. I was unable to get anything but base64 responses until I disabled binary_support. |
+1 |
I ran into the same issue and worked around it by adding |
Just want to note that the "Binary Media Types" RestAPI Settings for the ApiGateway if defined as "/" may cause APIGateway to encode incoming request.body to b64. |
I put a PR together to work on some of the issues around this. It may only work for my use case though... |
It seems that Zappa always responds with a base64 encoded string for the response body and "isBase64Encoded" set to true.
The relevant file is the "handler.py" file provided/generated by Zappa.
On line 513, we have this if statement:
The condition's negation is:
Clearly this is a contradiction, so the condition itself is a tautology. The true branch is taken and Zappa will always base64 encode responses.
It seems that the intention of the condition is to NOT base64 encode responses that are text (but to take a conservative approach to determine what is "text").
It seems that what we want is to NOT base64 encode when this condition is true:
If this is the case, the condition starting on line 513 should instead be:
I noticed this while using Zappa 0.46.2
The text was updated successfully, but these errors were encountered: