Skip to content

Commit e4c7b6f

Browse files
Check if value header is undefined to avoid crash. (#453)
1 parent 7931bee commit e4c7b6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/open-next/src/converters/aws-apigw-v2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ function convertToApiGatewayProxyResultV2(
9797
),
9898
)
9999
.forEach(([key, value]) => {
100-
if (value === null) {
100+
if (value === null || value === undefined) {
101101
headers[key] = "";
102102
return;
103103
}
104-
headers[key] = Array.isArray(value) ? value.join(", ") : value.toString();
104+
headers[key] = Array.isArray(value) ? value.join(", ") : `${value}`;
105105
});
106106

107107
const response: APIGatewayProxyResultV2 = {

0 commit comments

Comments
 (0)