harden server further against bad channel ids

pull/1/head
ansuz 7 years ago
parent 06c971ec47
commit a28a59abf0

@ -28,8 +28,8 @@ var WARN = function (e, output) {
};
var isValidId = function (chan) {
return chan && chan.length && /^[a-fA-F0-9]/.test(chan) ||
[32, 48].indexOf(chan.length) !== -1;
return chan && chan.length && /^[a-fA-F0-9]/.test(chan) &&
[32, 48].indexOf(chan.length) > -1;
};
var uint8ArrayToHex = function (a) {

Loading…
Cancel
Save