From 1c07ae2650b5ad3d0023f3af7308fe120de19dc9 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Tue, 4 Jul 2023 10:06:11 +0800 Subject: [PATCH] fix: escape on resource filename (#1892) add escape on resource filename --- web/src/utils/resource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/utils/resource.ts b/web/src/utils/resource.ts index e217e87a..079536cb 100644 --- a/web/src/utils/resource.ts +++ b/web/src/utils/resource.ts @@ -3,5 +3,5 @@ export const getResourceUrl = (resource: Resource, withOrigin = true) => { return resource.externalLink; } - return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${resource.publicId}/${resource.filename}`; + return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${resource.publicId}/${encodeURIComponent(resource.filename)}`; };