We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6ccd2c commit 2e472e8Copy full SHA for 2e472e8
src/utils/body.ts
@@ -30,9 +30,8 @@ export function readRawBody<E extends Encoding = "utf8">(
30
(event.node.req as any)[RawBodySymbol] ||
31
(event.node.req as any).body; /* unjs/unenv #8 */
32
if (_rawBody) {
33
- const promise = Promise.resolve(
34
- Buffer.isBuffer(_rawBody) ? _rawBody : Buffer.from(_rawBody)
35
- );
+ const promise = Promise.resolve(_rawBody)
+ .then(_resolved => Buffer.isBuffer(_resolved) ? _resolved : Buffer.from(_resolved))
36
return encoding
37
? promise.then((buff) => buff.toString(encoding))
38
: (promise as Promise<any>);
0 commit comments