From 2990ddc1c39127b151cf8ef4587287f6ce7974af Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 7 Mar 2014 19:12:36 -0700 Subject: [PATCH] don't re-add if array is tagged with __injected --- ca-store-generator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ca-store-generator.js b/ca-store-generator.js index cdeeea5..c2fb49b 100644 --- a/ca-store-generator.js +++ b/ca-store-generator.js @@ -130,7 +130,8 @@ function dumpCerts(certs) { + '\n];\n' + "module.exports.inject = function () {\n" + " var opts = require('https').globalAgent.options;\n" - + " if (!opts.ca || opts.ca.length < 100) { opts.ca = (opts.ca||[]).concat(cas); }" + + " if (!opts.ca || !opts.ca.__injected) { opts.ca = (opts.ca||[]).concat(cas); }\n" + + " opts.ca.__injected = true;\n" + "};\n" ); console.info("Wrote '" + OUTFILE.replace(/'/g, "\\'") + "'.");