This commit is contained in:
2026-07-06 17:06:25 +03:30
parent 06bfbd1ee5
commit 53ccb2fc30
3 changed files with 61 additions and 15 deletions
+12
View File
@@ -84,6 +84,18 @@ export function toAbsoluteFileUrl(path?: string | null): string | undefined {
return trimmed
}
const storageMatch = trimmed.match(/(?:^|\/)storage\/(.+)$/i)
if (storageMatch) {
const base = getFileBaseUrl()
if (base) {
return `${base}/storage/${storageMatch[1]}`
}
}
if (/^[a-z0-9.-]+(?:\/server)?\/storage\//i.test(trimmed)) {
return `https://${trimmed.replace(/^\/+/, '')}`
}
const base = getFileBaseUrl()
if (!base) return undefined