10666: Merge branch 'master' into 10666-report-version
[arvados.git] / apps / workbench / app / assets / javascripts / models / session_db.js
index 01b0d72728c17d9531665058d397857ff3fa3b99..ad9ad1878417370dfd75294e9bd9cecbe25880d1 100644 (file)
@@ -135,7 +135,9 @@ window.SessionDB = function() {
             // the host part of apihostport is an IPv4 or [IPv6]
             // address.
             if (!session.baseURL.match('://(\\[|\\d+\\.\\d+\\.\\d+\\.\\d+[:/])'))
-                return session.baseURL.replace('://', '://workbench.')
+                var wbUrl = session.baseURL.replace('://', '://workbench.')
+                // Remove the trailing slash, if it's there.
+                return wbUrl.slice(-1) == '/' ? wbUrl.slice(0, -1) : wbUrl
             return null
         },
         // Return a m.stream that will get fulfilled with the