From 39ddf70fa070c7319b09e92699430d992206576f Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Thu, 25 Apr 2024 04:23:10 +0200 Subject: [PATCH] url: fix `isURL` detection by checking `path` Fixes: https://github.com/nodejs/node/issues/48921 PR-URL: https://github.com/nodejs/node/pull/48928 Backport-PR-URL: https://github.com/nodejs/node/pull/50105 Fixes: https://github.com/getsentry/sentry-javascript/issues/8552 Fixes: https://github.com/request/request/issues/3458 Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca Reviewed-By: Matthew Aitken Reviewed-By: Debadree Chatterjee --- graal-nodejs/test/parallel/test-url-is-url.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graal-nodejs/test/parallel/test-url-is-url.js b/graal-nodejs/test/parallel/test-url-is-url.js index 0b42bb3b2f2..6bb8a1595df 100644 --- a/graal-nodejs/test/parallel/test-url-is-url.js +++ b/graal-nodejs/test/parallel/test-url-is-url.js @@ -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);