From df0f8706652a93dce625442ddf15c941747e8458 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 1 Apr 2019 14:18:33 -0600 Subject: [PATCH] v2.7.1: workaround for bug in some versions of greenlock-express --- lib/core.js | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/core.js b/lib/core.js index aaf1555..beb81ce 100644 --- a/lib/core.js +++ b/lib/core.js @@ -434,7 +434,9 @@ module.exports.create = function (gl) { , checkAsync: function (args) { var copy = utils.merge(args, gl); // if approveDomains doesn't set subject, we set it here - copy.subject = copy.subject || copy.domains[0]; + if (!(copy.domains && copy.domains.length)) { copy.domains = [ copy.subject || copy.domain ].filter(Boolean); } + if (!copy.subject) { copy.subject = copy.domains[0]; } + if (!copy.domain) { copy.domain = copy.domains[0]; } args = utils.tplCopy(copy); // returns pems @@ -456,7 +458,9 @@ module.exports.create = function (gl) { , getAsync: function (args) { var copy = utils.merge(args, gl); // if approveDomains doesn't set subject, we set it here - copy.subject = copy.subject || copy.domains[0]; + if (!(copy.domains && copy.domains.length)) { copy.domains = [ copy.subject || copy.domain ].filter(Boolean); } + if (!copy.subject) { copy.subject = copy.domains[0]; } + if (!copy.domain) { copy.domain = copy.domains[0]; } args = utils.tplCopy(copy); if (args.certificate && args.certificate.privkey && args.certificate.cert && args.certificate.chain) { diff --git a/package.json b/package.json index d302d8d..fe46f43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock", - "version": "2.7.0", + "version": "2.7.1", "description": "Let's Encrypt for node.js on npm", "main": "index.js", "files": [