From 60ab094b27607320322603ec1c68e9d0b02e04b5 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 1 May 2014 16:16:14 -0700 Subject: build referer header out of strings only --- lib/npm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/npm.js') 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) -- cgit v1.2.3