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
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 aduh95 committed Oct 9, 2023
1 parent 1ea10db commit e0891a8
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 e0891a8

Please sign in to comment.