Skip to content

Commit

Permalink
url: fix isURL detection by checking path
Browse files Browse the repository at this point in the history
Fixes: #48921
PR-URL: #48928
Backport-PR-URL: #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
Zhangdroid authored and targos committed Nov 27, 2023
1 parent 916a63b commit 7fc15b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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 7fc15b6

Please sign in to comment.