From 6fc1fa0bf6288ff93ac2ec4b4a603333478202cf Mon Sep 17 00:00:00 2001 From: whitecolor Date: Wed, 7 Jun 2017 17:26:59 +0500 Subject: [PATCH] fix sub-host cli again --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index c046196..a79a376 100644 --- a/server.js +++ b/server.js @@ -51,8 +51,8 @@ function maybe_bounce(req, res, sock, head, opt) { if (subdomain && opt.subHost) { const subHosts = Array.isArray(opt.subHost) - ? opt.subHost : [opt.subHost] - const subHost = opt.subHost.reduce((found, sub) => { + ? opt.subHost : [opt.subHost] + const subHost = subHosts.reduce((found, sub) => { return found || (subdomain.slice(-sub.length) == sub ? sub : '') }, '')