diff options
Diffstat (limited to 'web_src/js/utils.js')
-rw-r--r-- | web_src/js/utils.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web_src/js/utils.js b/web_src/js/utils.js index 01c076aeba..b9cd69e15a 100644 --- a/web_src/js/utils.js +++ b/web_src/js/utils.js @@ -133,3 +133,10 @@ export function convertImage(blob, mime) { } }); } + +export function toAbsoluteUrl(relUrl) { + if (relUrl.startsWith('http://') || relUrl.startsWith('https://')) { + return relUrl; + } + return `${window.location.origin}${relUrl}`; +} |