diff --git a/coffees/main.coffee b/coffees/main.coffee index 1d5746d..a56f97d 100644 --- a/coffees/main.coffee +++ b/coffees/main.coffee @@ -34,11 +34,12 @@ document.addEventListener 'DOMContentLoaded', -> wsUrl = 'ws://' rootPath = document.body.getAttribute('data-root-path') + rootPath = rootPath.replace(/^\/+|\/+$/g, '') if rootPath.length rootPath = "/#{rootPath}" wsUrl += document.location.host + rootPath - path = location.pathname + path = '/' if path.indexOf('/session') < 0 path += "session/#{document.body.getAttribute('data-session-token')}"