fix sub-host cli handling

This commit is contained in:
whitecolor
2017-06-07 17:02:51 +05:00
parent 5bc44fb901
commit 830476db19
2 changed files with 3 additions and 2 deletions
+2
View File
@@ -50,6 +50,8 @@ function maybe_bounce(req, res, sock, head, opt) {
let subdomain = tldjs.getSubdomain(hostname);
if (subdomain && opt.subHost) {
const subHosts = Array.isArray(opt.subHost)
? opt.subHost : [opt.subHost]
const subHost = opt.subHost.reduce((found, sub) => {
return found
|| (subdomain.slice(-sub.length) == sub ? sub : '')