Skip to content

Commit 14a7a45

Browse files
authored
fix(browser): use valid urls in Request checks (#5630)
In Deno `@sentry/browser` is almost usable, but the check `new Request('')` fails silently because Deno throws a `TypeError: invalid URL` that goes to a catch block. This changes the Request call to include a valid URL `http://www.example.com` so that `@sentry/browser` can be imported in Deno without this issue.
1 parent 7633952 commit 14a7a45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/browser/test/integration/common/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function supportsFetch() {
77

88
try {
99
new Headers();
10-
new Request('');
10+
new Request('http://www.example.com');
1111
new Response();
1212
return true;
1313
} catch (e) {

packages/utils/src/supports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function supportsFetch(): boolean {
6262

6363
try {
6464
new Headers();
65-
new Request('');
65+
new Request('http://www.example.com');
6666
new Response();
6767
return true;
6868
} catch (e) {

0 commit comments

Comments
 (0)