From 431ba1d8087dcdc44368c6cc97c1a2f57affe939 Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Tue, 31 Oct 2017 06:32:07 +0530 Subject: [PATCH] Fixed isTrue variable initialization in validate.JS --- index.js | 5 ++++- util/validate.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1479083..d02dda7 100644 --- a/index.js +++ b/index.js @@ -61,7 +61,10 @@ program console.log(portInvalidMsg[1]) return } else { */ - if (!validate(domain, inPort, outPort)) return + if (!validate(domain, inPort, outPort)) { + console.log("I should get printed if I'm not validated") + return + } createProxyServer(domain, inPort, outPort) console.log("Done! Your server has been set up!\nPoint your domain to this server and check " + chalk.cyan(domain) + " to verify!") //} diff --git a/util/validate.js b/util/validate.js index 66bb193..c2b1d9b 100644 --- a/util/validate.js +++ b/util/validate.js @@ -8,7 +8,7 @@ function validate(domain, inPort, outPort = undefined) { var portInvalidMsg = ["\nPort should be a number.", "\nPort should be a number from 1 and 65535."] var validInPort = /^\d+$/.test(inPort) var validOutPort = /^\d+$/.test(outPort) - var isTrue + var isTrue = true if (!isDomain(domain)) { console.log(domainInvalidMsg) return isTrue = false