mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 06:10:01 -04:00
handle undefined body
This commit is contained in:
parent
b73a561844
commit
055f120271
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ const NULL_BODY_STATUSES = [101, 103, 204, 205, 304];
|
|||
function createBodyStream(
|
||||
body: BodyInit | null
|
||||
): ReadableStream<ArrayBuffer | Uint8Array> | null {
|
||||
if (body === null) return null;
|
||||
if (body === null || typeof body === "undefined") return null;
|
||||
|
||||
if (typeof body === "string") {
|
||||
body = new TextEncoder().encode(body);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue