diff --git a/packages/open-next/src/converters/aws-apigw-v2.ts b/packages/open-next/src/converters/aws-apigw-v2.ts index 7490e2c9f..58c8e7e1a 100644 --- a/packages/open-next/src/converters/aws-apigw-v2.ts +++ b/packages/open-next/src/converters/aws-apigw-v2.ts @@ -97,11 +97,11 @@ function convertToApiGatewayProxyResultV2( ), ) .forEach(([key, value]) => { - if (value === null) { + if (value === null || value === undefined) { headers[key] = ""; return; } - headers[key] = Array.isArray(value) ? value.join(", ") : value.toString(); + headers[key] = Array.isArray(value) ? value.join(", ") : `${value}`; }); const response: APIGatewayProxyResultV2 = {