Handle an server getNotenameFromSocket referer undefined exception
This commit is contained in:
parent
f359044776
commit
bbcc64af6b
1 changed files with 5 additions and 1 deletions
|
@ -151,7 +151,11 @@ function getStatus(callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotenameFromSocket(socket) {
|
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];
|
var notename = hostUrl.pathname.split('/')[1];
|
||||||
if (notename == config.featuresnotename) {
|
if (notename == config.featuresnotename) {
|
||||||
return notename;
|
return notename;
|
||||||
|
|
Loading…
Reference in a new issue