Fixed the banner newline/carriage return fix...

To not capture \r\n when looking for \r to fix formatting of banner messages.
This commit is contained in:
Bill Church 2017-02-09 11:49:51 -05:00 committed by GitHub
parent 1725cdaa85
commit b86ae3e88d

View file

@ -61,7 +61,7 @@ io.on('connection', function(socket) {
var conn = new ssh();
conn.on('banner', function(d) {
//need to convert to cr/lf for proper formatting
d = d.replace(/\n/g, "\r\n");
d = d.replace(/\r?\n/g, "\r\n");
socket.emit('data', d.toString('binary'));
}).on('ready', function() {
socket.emit('title', 'ssh://' + config.ssh.host);
@ -114,4 +114,4 @@ io.on('connection', function(socket) {
'hmac': ['hmac-sha1', 'hmac-sha1-96', 'hmac-md5-96']
}
});
});
});