I am building a serverless website with AWS API Gateway (APIG) and Lambda features. I have to use integration with a proxy server because the Lambda function behind should receive HTTP request headers. At the same time, some binary data needs to be maintained. In my case, the favicon.ico file. Other people may want to use dynamically generated PDF or Excel files. APIG has binary support for this purpose. Encode base64 data and configure this type of MIME content so that it can be decoded before it is sent to the client. However, this does not work with proxy integration. Proxy integration simply skips part of the integration response.
I tried redirecting favicon.ico request to the S3 endpoint, but browsers show strange behavior. Because the ico file is from a different and redirected domain, not one domain.
Encoding it with base64 and allowing you to decode the client browser is not an option, since it is not standard and may not work in all browsers.
I suppose I can't do anything until AWS adds a new feature to this. Has anyone looked into this problem? Any idea or suggestion?
source
share