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
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-05-02 03:16:14 +0400
committerisaacs <i@izs.me>2014-05-02 03:16:14 +0400
commit60ab094b27607320322603ec1c68e9d0b02e04b5 (patch)
tree9eb193a903df1196cf0ae80b0c2f90cb36ffdc31 /lib/npm.js
parent90b8427a308e2b27f76d7ebb454e27abbd745df7 (diff)
build referer header out of strings only
Diffstat (limited to 'lib/npm.js')
-rw-r--r--lib/npm.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/npm.js b/lib/npm.js
index c8965bdc6..63f9be315 100644
--- a/lib/npm.js
+++ b/lib/npm.js
@@ -207,13 +207,13 @@ Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) {
npm.registry.refer = [a].concat(args[0]).map(function (arg) {
// exclude anything that might be a URL, path, or private module
// Those things will always have a slash in them somewhere
- if (arg && arg.match(/\/|\\/)) {
+ if (arg && arg.match && arg.match(/\/|\\/)) {
return "[REDACTED]"
} else {
return arg
}
}).filter(function (arg) {
- return arg
+ return arg && arg.match
}).join(" ")
cmd.apply(npm, args)