I've created a lambda to upload and download images to s3.
The problem I'm facing is that I am struggling with the proxy integration from the API Gateway.
After check the documentation and this question about Gateway and Lambda to Return Image I can either have the upload working or the download working but not both :(
If I add - */*
in the binaryMediaTypes from apiGateway in my serverless.yml file as it was suggested in the linked stack over flow question I got the download to work but then my upload func brakes...(It returns 502)
If I don't add this */*
, upload works but then I cannot do the download...
I've tried to do the upload from different ways such as adding the file in a form or in the body as a base64 string, both work without the */*
but brakes when the */*
is added...
I couldn't find another way to make the download to work in a way that I don't brake the upload part...
Any clues?
( obs1: I am setting the content-type to 'image/jpeg' in the download return obj )
(obs2: I know you can download image directly from s3 but I have some logic implemented on the lambda to decide which image should be served so I want to do this through the lambda)
Here is the part of the serverless.yml file regarding the gateway: