diff --git a/src/fetch.ts b/src/fetch.ts index 9a5da85e..9db8de8f 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -195,8 +195,9 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { const hasBody = (context.response.body || - // https://github.com/JakeChampion/fetch/issues/1454 + // 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"; @@ -217,10 +218,8 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { } case "stream": { context.response._data = - context.response.body || - // https://github.com/JakeChampion/fetch/issues/1454 - // https://github.com/unjs/ofetch/issues/294 - (context.response as any)._bodyInit; + context.response.body || + (context.response as any)._bodyInit; // (see refs above) break; } default: {