diff --git a/src/utils/phoenix-utils.js b/src/utils/phoenix-utils.js index 5d5307db881d1f8be8415908d04478d83ebb43ad..7cbca9fa0490fbe11029cebba588f8f09598d8db 100644 --- a/src/utils/phoenix-utils.js +++ b/src/utils/phoenix-utils.js @@ -36,9 +36,13 @@ export function connectToReticulum(debug = false) { return socket; } -export function getReticulumFetchUrl(path) { +const resolverLink = document.createElement("a"); +export function getReticulumFetchUrl(path, absolute = false) { if (process.env.RETICULUM_SERVER) { return `https://${process.env.RETICULUM_SERVER}${path}`; + } else if (absolute) { + resolverLink.href = path; + return resolverLink.href; } else { return path; } @@ -46,5 +50,5 @@ export function getReticulumFetchUrl(path) { export function getLandingPageForPhoto(photoUrl) { const parsedUrl = new URL(photoUrl); - return getReticulumFetchUrl(parsedUrl.pathname.replace(".png", ".html") + parsedUrl.search); + return getReticulumFetchUrl(parsedUrl.pathname.replace(".png", ".html") + parsedUrl.search, true); }