fix sub-host cli again

This commit is contained in:
whitecolor
2017-06-07 17:26:59 +05:00
parent 830476db19
commit 6fc1fa0bf6
+2 -2
View File
@@ -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 : '')
}, '')