-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to set "contentHandling" #553
Comments
Hi @tayler-kemsley! Thank you for bringing this up. If I understand this right, it looks like we would need to surface another CORS field, |
Hi @keetonian, yes I believe thats correct. Interestingly, I couldn't even find a way to set To be completely honest, I'm not that familiar with them either. The working examples above were the result of a lot of trial and error. Also note I made a small amendment to my original comment, markdown was trying to use the |
Just wanted to clarify that this isn't a CORS field so much as an API Gateway configuration setting. |
@tayler-kemsley Figured out a workaround that you may be able to use, see #566 (comment) |
@0xdevalias Thanks, yeah I ended up with a very similar approach to you. |
PR for fixing BinaryMediaTypes is in update #954 |
Removed "waiting-for-release" label as this issue is not solved by the referenced PR. By default in lambda proxy integrations, Sample event structure: Events:
Image:
Type: Api
Properties:
Method: get
Path: /
ContentHandling: CONVERT_TO_BINARY This will, if the BinaryMediaTypes property is set on the API, allow the api in this method to return binary content, such as images. |
I'm having the same issue. I 'm returning and image from lambda but it is not always converting. If I use < img src= "url_image"> -> it works. Setting binary-media type to image/* If I try to access url_image from a browser it doesn't works unless setting binary-media type to / o text/html |
Hi AWS Team, Have you planned to add ContentHandling: CONVERT_TO_BINARY to API Event? is it something you consider to do? Thanks |
Hi, any update on this? |
It's really unfortunate seeing all this activity from 2019 and the PRs ended up getting closed and not merged. I don't agree with the conclusion reached, this table response format https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings-workflow.html defines the behavior of API GW under different scenarios and it's not equivalent to This take #1001 (review) is still true today. |
I've found that setting the 'x-amazon-apigateway-binary-media-types' to
*/*
causes 500 errors.Using the API to set the content handling to "CONVERT_TO_TEXT" resolves the issue, but there doesn't seem to be a way to define that in the SAM CORS configuration, so the requests will always fail. (See below for error)
The error from API gateway is as follows:
This is the output of the API integration in a working case:
The text was updated successfully, but these errors were encountered: