remove legacy code to solve #58

Signed-off-by: Amolith <amolith@nixnet.xyz>
This commit is contained in:
Amolith 2019-10-03 08:39:51 -04:00
parent 7182fecf5b
commit e6eab33e2d
No known key found for this signature in database
GPG key ID: 51FD40936DB0065B

View file

@ -277,16 +277,6 @@ function extractNoteIdFromSocket (socket) {
}
if (socket.handshake.query && socket.handshake.query.noteId) {
return socket.handshake.query.noteId
} else if (socket.handshake.headers) {
// this part is only for backward compatibility only; current code
// should be using noteId query parameter instead.
var referer = socket.handshake.headers.referer
if (!referer) {
return false
}
var hostUrl = url.URL.parse(referer)
var noteId = config.urlPath ? hostUrl.pathname.slice(config.urlPath.length + 1, hostUrl.pathname.length).split('/')[1] : hostUrl.pathname.split('/')[1]
return noteId
} else {
return false
}