removed mixed operators from last commit
This commit is contained in:
parent
4540cc6e0e
commit
cdd50f7b22
7 changed files with 9 additions and 11 deletions
8
index.js
8
index.js
|
@ -41,17 +41,15 @@ app.disable('x-powered-by')
|
|||
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')))
|
||||
// capture and assign variables
|
||||
myHost = validator.isIP(req.params.host) ? req.params.host : undefined
|
||||
console.log('req.params.host: ', myHost)
|
||||
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,
|
||||
port: validator.isInt(req.query.port + '', {min: 1, max: 65535}) && req.query.port || config.ssh.port,
|
||||
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,
|
||||
header: {
|
||||
name: req.query.header || config.header.text,
|
||||
background: req.query.headerBackground || config.header.background
|
||||
},
|
||||
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
|
||||
}
|
||||
req.session.ssh.header.name && validator.escape(req.session.ssh.header.name)
|
||||
|
|
|
@ -99,7 +99,7 @@ socket.on('connect', function () {
|
|||
}).on('statusBackground', function (data) {
|
||||
document.getElementById('status').style.backgroundColor = data
|
||||
}).on('allowreplay', function (data) {
|
||||
if (data == true) {
|
||||
if (data === true) {
|
||||
console.log('allowreplay: ' + data)
|
||||
document.getElementById('credentials').style.display = 'inline'
|
||||
} else {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12605,7 +12605,7 @@ socket.on('connect', function () {
|
|||
}).on('statusBackground', function (data) {
|
||||
document.getElementById('status').style.backgroundColor = data
|
||||
}).on('allowreplay', function (data) {
|
||||
if (data == true) {
|
||||
if (data === true) {
|
||||
console.log('allowreplay: ' + data)
|
||||
document.getElementById('credentials').style.display = 'inline'
|
||||
} else {
|
||||
|
|
2
public/webssh2.min.js
vendored
2
public/webssh2.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -99,7 +99,7 @@ socket.on('connect', function () {
|
|||
}).on('statusBackground', function (data) {
|
||||
document.getElementById('status').style.backgroundColor = data
|
||||
}).on('allowreplay', function (data) {
|
||||
if (data == true) {
|
||||
if (data === true) {
|
||||
console.log('allowreplay: ' + data)
|
||||
document.getElementById('credentials').style.display = 'inline'
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue