http: convert token to buffer for ws auth.

This commit is contained in:
Christopher Jeffrey 2016-10-21 00:34:18 -07:00
parent b76a382f78
commit 21b2a12278
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1159,6 +1159,8 @@ HTTPServer.prototype._initIO = function _initIO() {
if (!utils.isHex256(token))
return callback({ error: 'Invalid parameter.' });
token = new Buffer(token, 'hex');
if (socket.api && id === '!all') {
socket.join(id);
return callback();