Skip to content

Titiler deployed in AWS Lambda returns empty PNGs #570

Discussion options

You must be logged in to vote

Thanks for the quick reply @vincentsarago! Hope you are doing well 🙌

I'm an idiot: I didn't setup my API gateway correctly, so the content was not getting base64 decoded when the images were returned from the Lambda. Enabling binary content type of */* sorted the issue out.

Partly this is also due to me using AWS CDK v2 - which remove the possibility of using an HTTP API integration for Lambda. Here is the API gateway definition that works for AWS CDK v2:

api = aws_apigateway.LambdaRestApi(
            self,
            f"{self.stack_name}-endpoint",
            handler=lambda_function,
            proxy=True,
            binary_media_types=["*/*"],
        )

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@vincentsarago
Comment options

Answer selected by rodrigoalmeida94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants