Skip to content

Commit

Permalink
fix(runtime): express cannot send number directly #816 (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow authored Feb 23, 2023
1 parent 5245473 commit c856fd8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtimes/nodejs/src/handler/invoke-func.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export async function handleInvokeFunction(req: IRequest, res: Response) {
)

if (res.writableEnded === false) {
return res.send(result.data)
let data = result.data
if (typeof result.data === 'number') {
data = Number(result.data).toString()
}
return res.send(data)
}
} catch (error) {
logger.error(requestId, 'failed to invoke error', error)
Expand Down

0 comments on commit c856fd8

Please sign in to comment.