Fix coffee as per #179

This commit is contained in:
Florian Mounier
2018-09-12 10:20:10 +02:00
parent 06751c68f9
commit 91d52ed6ae

View File

@@ -34,11 +34,12 @@ document.addEventListener 'DOMContentLoaded', ->
wsUrl = 'ws://' wsUrl = 'ws://'
rootPath = document.body.getAttribute('data-root-path') rootPath = document.body.getAttribute('data-root-path')
rootPath = rootPath.replace(/^\/+|\/+$/g, '')
if rootPath.length if rootPath.length
rootPath = "/#{rootPath}" rootPath = "/#{rootPath}"
wsUrl += document.location.host + rootPath wsUrl += document.location.host + rootPath
path = location.pathname path = '/'
if path.indexOf('/session') < 0 if path.indexOf('/session') < 0
path += "session/#{document.body.getAttribute('data-session-token')}" path += "session/#{document.body.getAttribute('data-session-token')}"