don't re-add if array is tagged with __injected

This commit is contained in:
AJ ONeal 2014-03-07 19:12:36 -07:00
parent 79f26ce66a
commit 2990ddc1c3
1 changed files with 2 additions and 1 deletions

View File

@ -130,7 +130,8 @@ function dumpCerts(certs) {
+ '\n];\n' + '\n];\n'
+ "module.exports.inject = function () {\n" + "module.exports.inject = function () {\n"
+ " var opts = require('https').globalAgent.options;\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" + "};\n"
); );
console.info("Wrote '" + OUTFILE.replace(/'/g, "\\'") + "'."); console.info("Wrote '" + OUTFILE.replace(/'/g, "\\'") + "'.");