From 2411dffa2ce997370a636ed56cc73bcc4661ec7f Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Wed, 7 Mar 2018 15:17:35 +0100 Subject: Change config to camel case with backwards compatibility This refactors the configs a bit to now use camel case everywhere. This change should help to clean up the config interface and make it better understandable. Signed-off-by: Sheogorath --- lib/realtime.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/realtime.js') diff --git a/lib/realtime.js b/lib/realtime.js index 5ee9f8fd..d8b0b4c5 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -45,10 +45,10 @@ function secure (socket, next) { var handshakeData = socket.request if (handshakeData.headers.cookie) { handshakeData.cookie = cookie.parse(handshakeData.headers.cookie) - handshakeData.sessionID = cookieParser.signedCookie(handshakeData.cookie[config.sessionname], config.sessionsecret) + handshakeData.sessionID = cookieParser.signedCookie(handshakeData.cookie[config.sessionName], config.sessionSecret) if (handshakeData.sessionID && - handshakeData.cookie[config.sessionname] && - handshakeData.cookie[config.sessionname] !== handshakeData.sessionID) { + handshakeData.cookie[config.sessionName] && + handshakeData.cookie[config.sessionName] !== handshakeData.sessionID) { if (config.debug) { logger.info('AUTH success cookie: ' + handshakeData.sessionID) } return next() } else { @@ -284,7 +284,7 @@ function extractNoteIdFromSocket (socket) { return false } var hostUrl = url.parse(referer) - var noteId = config.urlpath ? hostUrl.pathname.slice(config.urlpath.length + 1, hostUrl.pathname.length).split('/')[1] : hostUrl.pathname.split('/')[1] + 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 @@ -330,7 +330,7 @@ function emitRefresh (socket) { var note = notes[noteId] var out = { title: note.title, - docmaxlength: config.documentmaxlength, + docmaxlength: config.documentMaxLength, owner: note.owner, ownerprofile: note.ownerprofile, lastchangeuser: note.lastchangeuser, @@ -788,7 +788,7 @@ function connection (socket) { var note = notes[noteId] // Only owner can change permission if (note.owner && note.owner === socket.request.user.id) { - if (permission === 'freely' && !config.allowanonymous && !config.allowanonymousedits) return + if (permission === 'freely' && !config.allowAnonymous && !config.allowAnonymousedits) return note.permission = permission models.Note.update({ permission: permission -- cgit v1.2.3