From d81a2d0919eb0870af98c62054e7d4067048fd0c Mon Sep 17 00:00:00 2001 From: "F. N" Date: Tue, 16 Feb 2016 23:04:56 +0100 Subject: [PATCH] printing primitive arrays in opts in one line This fixes #22 and prints all arrays that contain only primitive values in one line like the key or cert buffer --- lib/sni-callback.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/sni-callback.js b/lib/sni-callback.js index 4b40c14..8396006 100644 --- a/lib/sni-callback.js +++ b/lib/sni-callback.js @@ -19,8 +19,13 @@ module.exports.create = function (opts) { if (!opts) { throw new Error("requires opts to be an object"); } if (opts.debug) { - console.debug("[LEX] creating sniCallback", JSON.stringify(opts, null, ' ')); + console.debug("[LEX] creating sniCallback", JSON.stringify(opts, function(k,v){ + if(v instanceof Array) + return JSON.stringify(v); + return v; + },' ')); } + if (!opts.letsencrypt) { throw new Error("requires opts.letsencrypt to be a letsencrypt instance"); } if (!opts.lifetime) { opts.lifetime = 90 * 24 * 60 * 60 * 1000; }