Skip to content

Commit

Permalink
url: fix isURL detection by checking path
Browse files Browse the repository at this point in the history
Fixes: nodejs/node#48921
PR-URL: nodejs/node#48928
Backport-PR-URL: nodejs/node#50105
Fixes: getsentry/sentry-javascript#8552
Fixes: request/request#3458
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent b3e3823 commit 52a3489
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graal-nodejs/test/parallel/test-url-is-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ const { isURL } = require('internal/url');

assert.strictEqual(isURL(new URL('https://www.nodejs.org')), true);
assert.strictEqual(isURL(parse('https://www.nodejs.org')), false);
assert.strictEqual(isURL({
href: 'https://www.nodejs.org',
protocol: 'https:',
path: '/',
}), false);

0 comments on commit 52a3489

Please sign in to comment.