mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
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) {
|
||||
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 a new issue