Gzipped content cannot be returned from an API Gateway
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description:
For local testing with lambdas behind an API Gateway, I cannot return gzipped content that is base64 encoded that API Gateway expects. Locally I can only return uncompressed API responses. The browser fails to decode the response from the local API Gateway.
Why this matters?
Cost, performance, aws limits for large responses.
What if I want gzipped content served from s3 or an API to return gzipped content?
If local responses are too large because they are uncompressed, they will be rejected even though they will work in AWS when compressed.
### Steps to reproduce:
Have any API Gateway response return a base64 encoded gziped response. The API Gateway response should indicate that the response is base64 encoded like API Gateway expects. Also ensure the Content-Encoding header is set to gzip.
### Observed result:
Base64 gziped content cannot be decoded by any browsers, but works when running in AWS.
### Expected result:
Local API Gateway returns a gzipped response.
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: MacOS
2. `sam --version`: 1.24.1
3. AWS region: us-east-1
Contributor guide
Assessment
This issue has not been assessed yet.