FIX: message bus when using a longPollingBaseUrl not replacing chars correctly

FIX: message bus when using a longPollingBaseUrl not replacing chars correctly

Implementation needs to match:

https://github.com/discourse/discourse/blob/03ba1d49fbdceaeec76301b0811daba5dca6cb94/app/assets/javascripts/discourse/initializers/message-bus.js.es6#L52-L53

diff --git a/manager-client/app/initializers/message-bus.js b/manager-client/app/initializers/message-bus.js
index 4a2de6c..52f8716 100644
--- a/manager-client/app/initializers/message-bus.js
+++ b/manager-client/app/initializers/message-bus.js
@@ -4,7 +4,7 @@ export default {
   name: "message-bus",
 
   initialize() {
-    MessageBus.baseUrl = Discourse.longPollingBaseUrl;
+    MessageBus.baseUrl = Discourse.longPollingBaseUrl.replace(/\/$/, "") + "/";
 
     if (MessageBus.baseUrl !== "/") {
       MessageBus.ajax = function(opts) {

GitHub sha: af60412e

1 Like