Skip to content

Commit e1dbea0

Browse files
committed
refactor: reintroduce response validation
1 parent be76bb2 commit e1dbea0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/functions/synchronous.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ const validateLambdaResponse = (lambdaResponse) => {
105105
error: `Your function response must have a numerical statusCode. You gave: $ ${lambdaResponse.statusCode}`,
106106
}
107107
}
108+
if (lambdaResponse.body && typeof lambdaResponse.body !== 'string' && !isStream(lambdaResponse.body)) {
109+
return { error: `Your function response must have a string or a stream body. You gave: ${lambdaResponse.body}` }
110+
}
108111

109112
return {}
110113
}

0 commit comments

Comments
 (0)