mirror of https://github.com/status-im/codimd.git
Handle an server getNotenameFromSocket referer undefined exception
This commit is contained in:
parent
f359044776
commit
bbcc64af6b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue