Fix trust center SPA asset loading on custom domains
The base tag was only set for /trust/{slug} paths, causing asset requests on custom domains to resolve relative to the page URL instead of root, resulting in 404 fallback to index.html.
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -6,11 +6,9 @@
|
|||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
var m = location.pathname.match(/^\/trust\/[^/]+/);
|
var m = location.pathname.match(/^\/trust\/[^/]+/);
|
||||||
if (m) {
|
|
||||||
var b = document.createElement("base");
|
var b = document.createElement("base");
|
||||||
b.href = m[0] + "/";
|
b.href = m ? m[0] + "/" : "/";
|
||||||
document.head.appendChild(b);
|
document.head.appendChild(b);
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user