From d9e3838562fdb4d4f9b6edeceaef45df6864e31e Mon Sep 17 00:00:00 2001 From: michael-bouvy Date: Mon, 2 Oct 2023 23:20:37 +0200 Subject: [PATCH] Handle base64 body in AWS Lambda preset --- src/runtime/entries/aws-lambda.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/entries/aws-lambda.ts b/src/runtime/entries/aws-lambda.ts index f906d6d85e..823643f637 100644 --- a/src/runtime/entries/aws-lambda.ts +++ b/src/runtime/entries/aws-lambda.ts @@ -52,7 +52,7 @@ export async function handler( headers: normalizeLambdaIncomingHeaders(event.headers), method, query, - body: event.body, // TODO: handle event.isBase64Encoded + body: event.isBase64Encoded ? Buffer.from(event.body, 'base64').toString('utf8') : event.body, }); // ApiGateway v2 https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.v2