mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
Merge pull request #187 from Amolith/master
remove legacy code to solve #58
This commit is contained in:
commit
09cf1057ef
1 changed files with 0 additions and 11 deletions
|
@ -3,7 +3,6 @@
|
|||
// external modules
|
||||
var cookie = require('cookie')
|
||||
var cookieParser = require('cookie-parser')
|
||||
var url = require('url')
|
||||
var async = require('async')
|
||||
var randomcolor = require('randomcolor')
|
||||
var Chance = require('chance')
|
||||
|
@ -277,16 +276,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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue