Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
fix: fix buffer event
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Apr 11, 2020
1 parent 7ff5e53 commit 2d43e75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/serverless-fc-starter/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ export class FCRuntime extends ServerlessLightRuntime {
if (event && event[FAAS_ARGS_KEY]) {
args.push(event[FAAS_ARGS_KEY]);
} else {
// 阿里云无触发器,入参是 buffer
if (Buffer.isBuffer(event)) {
event = event.toString('utf8');
try {
event = JSON.parse(event);
} catch (_err) {}
}
args.push(event);
}
// 其他事件场景
Expand Down

0 comments on commit 2d43e75

Please sign in to comment.