diff options
author | isaacs <i@izs.me> | 2014-05-02 03:16:14 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-05-02 03:16:14 +0400 |
commit | 60ab094b27607320322603ec1c68e9d0b02e04b5 (patch) | |
tree | 9eb193a903df1196cf0ae80b0c2f90cb36ffdc31 | |
parent | 90b8427a308e2b27f76d7ebb454e27abbd745df7 (diff) |
build referer header out of strings only
-rw-r--r-- | lib/npm.js | 4 |
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) |