From 648c454303096a8b1d58abc7dbde572bda3784f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 29 Aug 2025 13:07:46 -0400 Subject: [PATCH] refactor: leaner utils.params for relative path --- public/src/utils.common.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/public/src/utils.common.js b/public/src/utils.common.js index 47520b2425..4ecf17e4f2 100644 --- a/public/src/utils.common.js +++ b/public/src/utils.common.js @@ -570,12 +570,7 @@ const utils = { params: function (options = {}) { let url; if (options.url && !options.url.startsWith('http')) { - // relative path passed in - const cleanurl = options.url.replace(new RegExp(`/^${(options.relative_path || '')}/`, 'g'), ''); - url = new URL(document.location); - const queryIndex = cleanurl.indexOf('?'); - url.search = queryIndex !== -1 ? cleanurl.slice(queryIndex) : ''; - url.pathname = cleanurl; + url = new URL(options.url, 'http://dummybase'); } else { url = new URL(options.url || document.location); }