Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-11-10 01:33:33 +0300
committerGar <gar+gh@danger.computer>2021-11-10 02:06:56 +0300
commit7887fb3d7ba7f05abeb49dd92b76d90422cb38ca (patch)
tree3c919c3ae85fdee2c3cc2b2a075b59516d0e0aff /lib/utils
parentb8d608929f395d2d2fca4cb05905c5ef712c0faa (diff)
fix: don't try to open file:/// urls
These are never valid in the contexts from which this lib is called. Namely these are the bugs, docs, fund, help, and repo commands, and for oauth logins. PR-URL: https://github.com/npm/cli/pull/4025 Credit: @wraithgar Close: #4025 Reviewed-by: @isaacs
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/open-url.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/open-url.js b/lib/utils/open-url.js
index 21368efe7..ddbbddccf 100644
--- a/lib/utils/open-url.js
+++ b/lib/utils/open-url.js
@@ -25,7 +25,7 @@ const open = async (npm, url, errMsg) => {
}
try {
- if (!/^(https?|file):$/.test(new URL(url).protocol)) {
+ if (!/^https?:$/.test(new URL(url).protocol)) {
throw new Error()
}
} catch (_) {