summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/realtime.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/realtime.js b/lib/realtime.js
index 66a3c9c5..3e367158 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;