removed mixed operators from last commit

This commit is contained in:
billchurch 2017-05-27 18:22:28 -04:00
parent 4540cc6e0e
commit cdd50f7b22
7 changed files with 9 additions and 11 deletions

View file

@ -41,17 +41,15 @@ app.disable('x-powered-by')
app.get('/ssh/host/:host?', function (req, res, next) { app.get('/ssh/host/:host?', function (req, res, next) {
res.sendFile(path.join(path.join(__dirname, 'public', (config.useminified) ? 'client-min.htm' : 'client-full.htm'))) res.sendFile(path.join(path.join(__dirname, 'public', (config.useminified) ? 'client-min.htm' : 'client-full.htm')))
// capture and assign variables // capture and assign variables
myHost = validator.isIP(req.params.host) ? req.params.host : undefined
console.log('req.params.host: ', myHost)
req.session.ssh = { req.session.ssh = {
host: validator.isIP(req.params.host + '') && req.params.host || validator.isFQDN(req.params.host) && req.params.host || /^(([a-z]|[A-Z]|[0-9]|[!^(){}\-_~])+)?\w$/.test(req.params.host) && req.params.host || config.ssh.host, host: (validator.isIP(req.params.host + '') && req.params.host) || (validator.isFQDN(req.params.host) && req.params.host) || (/^(([a-z]|[A-Z]|[0-9]|[!^(){}\-_~])+)?\w$/.test(req.params.host) && req.params.host) || config.ssh.host,
port: validator.isInt(req.query.port + '', {min: 1, max: 65535}) && req.query.port || config.ssh.port, port: (validator.isInt(req.query.port + '', {min: 1, max: 65535}) && req.query.port) || config.ssh.port,
header: { header: {
name: req.query.header || config.header.text, name: req.query.header || config.header.text,
background: req.query.headerBackground || config.header.background background: req.query.headerBackground || config.header.background
}, },
algorithms: config.algorithms, algorithms: config.algorithms,
term: /^(([a-z]|[A-Z]|[0-9]|[!^(){}\-_~])+)?\w$/.test(req.query.sshterm) && req.query.sshterm || config.ssh.term, term: (/^(([a-z]|[A-Z]|[0-9]|[!^(){}\-_~])+)?\w$/.test(req.query.sshterm) && req.query.sshterm) || config.ssh.term,
allowreplay: validator.isBoolean(req.headers.allowreplay + '') || false allowreplay: validator.isBoolean(req.headers.allowreplay + '') || false
} }
req.session.ssh.header.name && validator.escape(req.session.ssh.header.name) req.session.ssh.header.name && validator.escape(req.session.ssh.header.name)

View file

@ -99,7 +99,7 @@ socket.on('connect', function () {
}).on('statusBackground', function (data) { }).on('statusBackground', function (data) {
document.getElementById('status').style.backgroundColor = data document.getElementById('status').style.backgroundColor = data
}).on('allowreplay', function (data) { }).on('allowreplay', function (data) {
if (data == true) { if (data === true) {
console.log('allowreplay: ' + data) console.log('allowreplay: ' + data)
document.getElementById('credentials').style.display = 'inline' document.getElementById('credentials').style.display = 'inline'
} else { } else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -12605,7 +12605,7 @@ socket.on('connect', function () {
}).on('statusBackground', function (data) { }).on('statusBackground', function (data) {
document.getElementById('status').style.backgroundColor = data document.getElementById('status').style.backgroundColor = data
}).on('allowreplay', function (data) { }).on('allowreplay', function (data) {
if (data == true) { if (data === true) {
console.log('allowreplay: ' + data) console.log('allowreplay: ' + data)
document.getElementById('credentials').style.display = 'inline' document.getElementById('credentials').style.display = 'inline'
} else { } else {

File diff suppressed because one or more lines are too long

View file

@ -99,7 +99,7 @@ socket.on('connect', function () {
}).on('statusBackground', function (data) { }).on('statusBackground', function (data) {
document.getElementById('status').style.backgroundColor = data document.getElementById('status').style.backgroundColor = data
}).on('allowreplay', function (data) { }).on('allowreplay', function (data) {
if (data == true) { if (data === true) {
console.log('allowreplay: ' + data) console.log('allowreplay: ' + data)
document.getElementById('credentials').style.display = 'inline' document.getElementById('credentials').style.display = 'inline'
} else { } else {