FIX: rewrite of `/my/`URL should work on sub directory site too.

FIX: rewrite of /my/URL should work on sub directory site too.

diff --git a/app/assets/javascripts/discourse/app/lib/url.js b/app/assets/javascripts/discourse/app/lib/url.js
index ae73638..682a625 100644
--- a/app/assets/javascripts/discourse/app/lib/url.js
+++ b/app/assets/javascripts/discourse/app/lib/url.js
@@ -243,7 +243,8 @@ const DiscourseURL = EmberObject.extend({
 
     // Rewrite /my/* urls
     let myPath = getURL("/my");
-    if (path.indexOf(myPath) === 0) {
+    const fullPath = getURL(path);
+    if (fullPath.indexOf(myPath) === 0) {
       const currentUser = User.current();
       if (currentUser) {
         path = path.replace(

GitHub sha: cdca5a2e

Any chances you can add a test as well?

Sure, added in FIX: replace `fullPath` while rewriting the `/my/` URLs.

1 Like