diff --git a/source/core/constants.ts b/source/core/constants.ts index 27309629..d854ce5d 100644 --- a/source/core/constants.ts +++ b/source/core/constants.ts @@ -9,15 +9,19 @@ export const supportsRequestStreams = (() => { const supportsRequest = typeof globalThis.Request === 'function'; if (supportsReadableStream && supportsRequest) { - hasContentType = new globalThis.Request('https://empty.invalid', { - body: new globalThis.ReadableStream(), - method: 'POST', - // @ts-expect-error - Types are outdated. - get duplex() { - duplexAccessed = true; - return 'half'; - }, - }).headers.has('Content-Type'); + try { + hasContentType = new globalThis.Request('https://empty.invalid', { + body: new globalThis.ReadableStream(), + method: 'POST', + // @ts-expect-error - Types are outdated. + get duplex() { + duplexAccessed = true; + return 'half'; + }, + }).headers.has('Content-Type'); + } catch { + // IOS QQBrowser throw "unsupported BodyInit type" Error + } } return duplexAccessed && !hasContentType;