From 66e9ecd2bf6fa7d38f41ff8cd5494d87197b75ce Mon Sep 17 00:00:00 2001 From: tigerbot Date: Fri, 4 Aug 2017 16:42:10 -0600 Subject: [PATCH] fixed bug in finding relevant http module for domains --- lib/modules/http.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/modules/http.js b/lib/modules/http.js index 303f195..887e417 100644 --- a/lib/modules/http.js +++ b/lib/modules/http.js @@ -419,12 +419,17 @@ module.exports.create = function (deps, conf, greenlockMiddleware) { return false; } - return dom.modules.some(function (mod) { + var subProm = PromiseA.resolve(false); + dom.modules.forEach(function (mod) { if (moduleChecks[mod.name]) { - return moduleChecks[mod.name](mod, conn, opts, headers); + subProm = subProm.then(function (handled) { + if (handled) { return handled; } + return moduleChecks[mod.name](mod, conn, opts, headers); + }); } console.warn('unknown HTTP module under domains', dom.names.join(','), mod); }); + return subProm; }); }); (conf.http.modules || []).forEach(function (mod) {