String response for lambda function - no need to strinfigy string (#6208)

This commit is contained in:
Vladimir Vlach
2023-10-20 07:27:36 +02:00
committed by GitHub
parent 66debb1ce4
commit 68324daf78

View File

@@ -279,7 +279,7 @@ async function sendResponse(response: unknown): Promise<void> {
}
await fetch(`runtime/invocation/${requestId}/response`, {
method: "POST",
body: response === null ? null : JSON.stringify(response),
body: response === null ? null : (typeof response === 'string' ? response : JSON.stringify(response)),
});
}