Skip to content

Commit 00e45d0

Browse files
authoredMar 16, 2023
Fix compatibility with native Fetch being disabled on Node.js (#494)
1 parent 719e549 commit 00e45d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎source/core/constants.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ export const supportsRequestStreams = (() => {
55
let duplexAccessed = false;
66
let hasContentType = false;
77
const supportsReadableStream = typeof globalThis.ReadableStream === 'function';
8+
const supportsRequest = typeof globalThis.Request === 'function';
89

9-
if (supportsReadableStream) {
10+
if (supportsReadableStream && supportsRequest) {
1011
hasContentType = new globalThis.Request('https://a.com', {
1112
body: new globalThis.ReadableStream(),
1213
method: 'POST',

0 commit comments

Comments
 (0)
Please sign in to comment.