Skip to content

Commit fb67650

Browse files
authored
fix(core): Check fetch support with data URL (#18225)
As Deno requires a valid URL when calling `new Request`, `example.com` was used but this caused problems. This PR changes it to a data URL as it does not rely on external dependencies and is a valid URL in Deno. Fixes: #18218 Previous PR for that: #5630
1 parent 5a5e091 commit fb67650

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/utils/supports.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ function _isFetchSupported(): boolean {
8080

8181
try {
8282
new Headers();
83-
new Request('http://www.example.com');
83+
// Deno requires a valid URL so '' cannot be used as an argument
84+
new Request('data:,');
8485
new Response();
8586
return true;
8687
} catch {

0 commit comments

Comments
 (0)