diff --git a/src/fetch.ts b/src/fetch.ts index 3c2b440..9bd3c96 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -194,7 +194,11 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { } const hasBody = - context.response.body && + (context.response.body || + // https://github.com/unjs/ofetch/issues/324 + // https://github.com/unjs/ofetch/issues/294 + // https://github.com/JakeChampion/fetch/issues/1454 + (context.response as any)._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD"; if (hasBody) { @@ -213,7 +217,8 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { break; } case "stream": { - context.response._data = context.response.body; + context.response._data = + context.response.body || (context.response as any)._bodyInit; // (see refs above) break; } default: {