diff --git a/src/fetch.ts b/src/fetch.ts index c0021c08..f82994d5 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -169,11 +169,10 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { return await onError(context); } - const hasBody = - context.response.body && + const allowParse = !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD"; - if (hasBody) { + if (allowParse) { const responseType = (context.options.parseResponse ? "json" @@ -189,7 +188,12 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch { break; } case "stream": { - context.response._data = context.response.body; + context.response._data = + context.response.body || + // @ts-ignore Compatible with QQ Browser on iOS + context.response._bodyInit?.stream() || + // @ts-ignore Compatible with QQ Browser on iOS + context.response._bodyBlob?.stream(); break; } default: {