fix: escape on resource filename (#1892)

add escape on resource filename
This commit is contained in:
Athurg Gooth 2023-07-04 10:06:11 +08:00 committed by GitHub
parent 5b6c98582e
commit 1c07ae2650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)}`;
};