diff --git a/lib/realtime.js b/lib/realtime.js index 66a3c9c..3e36715 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -151,7 +151,11 @@ function getStatus(callback) { } function getNotenameFromSocket(socket) { - var hostUrl = url.parse(socket.handshake.headers.referer); + var referer = socket.handshake.headers.referer; + if (!referer) { + return socket.disconnect(); + } + var hostUrl = url.parse(referer); var notename = hostUrl.pathname.split('/')[1]; if (notename == config.featuresnotename) { return notename;