logging says authorized upon unauthorized error #1050

jayyvis opened this Issue Oct 15, 2012 · 0 comments


None yet

1 participant

jayyvis commented Oct 15, 2012

socket.io version: 0.9.10
problem source : Manager.prototype.authorize = function (data, fn)

I was validating a client unauthorized error and noticed that the log says 'authorized' while it is unauthorized.

debug - authorized //wrong log output
info - handshake unauthorized

//statement that produced the wrong log
self.log.debug('client ' + authorized ? 'authorized' : 'unauthorized');

fix: operator precedence

self.log.debug('client ' + (authorized ? 'authorized' : 'unauthorized'));

debug - client unauthorized //correct log
info - handshake unauthorized

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment