Skip to content

supportsStreamingFetchBody

supportsStreamingFetchBody(): boolean

Defined in: packages/synapse-core/src/utils/streams.ts:141

Detect whether the current environment supports ReadableStream as a fetch request body. Firefox stringifies the stream to “[object ReadableStream]” instead of consuming it, and Safari silently ignores the stream body and the duplex option. This check catches both: a browser that stringifies will set Content-Type to text/plain (string body), and one that ignores duplex will fail the duplexAccessed gate. The try/catch handles any future browser that throws on the Request constructor.

Result is memoized after the first call.

boolean