diff --git a/src/utils/body.ts b/src/utils/body.ts index ef4f6f77..3842af7e 100644 --- a/src/utils/body.ts +++ b/src/utils/body.ts @@ -30,9 +30,8 @@ export function readRawBody( (event.node.req as any)[RawBodySymbol] || (event.node.req as any).body; /* unjs/unenv #8 */ if (_rawBody) { - const promise = Promise.resolve( - Buffer.isBuffer(_rawBody) ? _rawBody : Buffer.from(_rawBody) - ); + const promise = Promise.resolve(_rawBody) + .then(_resolved => Buffer.isBuffer(_resolved) ? _resolved : Buffer.from(_resolved)) return encoding ? promise.then((buff) => buff.toString(encoding)) : (promise as Promise);