summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheogorath2019-10-05 13:30:38 +0200
committerGitHub2019-10-05 13:30:38 +0200
commit09cf1057efbd8ed4f18ab85dfd04ada91c8b6f3b (patch)
treec28bb86a925d034202e4c3b3bee6f074f12223ec
parent7182fecf5b81b9a64d61f6d3030155d3afa7b025 (diff)
parent71e900e9e887c8f05519693ddd0aa10a496d6194 (diff)
Merge pull request #187 from Amolith/master
remove legacy code to solve #58
-rw-r--r--lib/realtime.js11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/realtime.js b/lib/realtime.js
index d85d728e..ec99707e 100644
--- a/lib/realtime.js
+++ b/lib/realtime.js
@@ -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
}