FIX: ensures static pages are using absolute path (#7828)

FIX: ensures static pages are using absolute path (#7828)

diff --git a/app/assets/javascripts/discourse/models/static-page.js.es6 b/app/assets/javascripts/discourse/models/static-page.js.es6
index d32160c..a8cdb25 100644
--- a/app/assets/javascripts/discourse/models/static-page.js.es6
+++ b/app/assets/javascripts/discourse/models/static-page.js.es6
@@ -12,11 +12,11 @@ StaticPage.reopenClass({
         text = text.match(
           /<!-- preload-content: -->((?:.|[\n\r])*)<!-- :preload-content -->/
         )[1];
-        resolve(StaticPage.create({ path: path, html: text }));
+        resolve(StaticPage.create({ path, html: text }));
       } else {
-        ajax(path + ".html", { dataType: "html" }).then(function(result) {
-          resolve(StaticPage.create({ path: path, html: result }));
-        });
+        ajax(`/${path}.html`, { dataType: "html" }).then(result =>
+          resolve(StaticPage.create({ path, html: result }))
+        );
       }
     });
   }

GitHub sha: 384f5cea

1 Like