From 5ab0b9423e579e603db0f6d1bd5cf66650afd94d Mon Sep 17 00:00:00 2001 From: Joshua Sosso Date: Tue, 8 Oct 2024 10:34:47 -0500 Subject: [PATCH] check for _bodyInit in "stream" responseType case --- src/fetch.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fetch.ts b/src/fetch.ts index ec1141d6..d81b0d58 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -215,7 +215,10 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { break; } case "stream": { - context.response._data = context.response.body; + context.response._data = + context.response.body || + // https://github.com/JakeChampion/fetch/issues/1454 + (context.response as any)._bodyInit; break; } default: {