-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,12 @@ export function readRawBody<E extends Encoding = "utf8">( | |
(event.node.req as any)[RawBodySymbol] || | ||
(event.node.req as any).body; /* unjs/unenv #8 */ | ||
if (_rawBody) { | ||
const promise = Promise.resolve(_rawBody); | ||
return encoding ? promise.then((buff) => buff.toString(encoding)) : promise; | ||
const promise = Promise.resolve( | ||
Buffer.isBuffer(_rawBody) ? _rawBody : Buffer.from(_rawBody) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
snsxn
|
||
); | ||
return encoding | ||
? promise.then((buff) => buff.toString(encoding)) | ||
: (promise as Promise<any>); | ||
} | ||
|
||
if (!Number.parseInt(event.node.req.headers["content-length"] || "")) { | ||
|
@pi0 Shouldn't this be?
Currently getting this error when yarn upgraded to v1.6.4