Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: url encode for tag name (#1031)

boojack4de65ab55d29
diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts
index 94c79e780..f347de17e 100644
--- a/web/src/helpers/api.ts
+++ b/web/src/helpers/api.ts
@@ -202,7 +202,7 @@ export function upsertTag(tagName: string) {
}
export function deleteTag(tagName: string) {
- return axios.delete<ResponseObject<string>>(`/api/tag/${encodeURI(tagName)}`);
+ return axios.delete<ResponseObject<string>>(`/api/tag/${encodeURIComponent(tagName)}`);
}
export async function getRepoStarCount() {
diff --git a/web/src/utils/resource.ts b/web/src/utils/resource.ts
index cfe54d5f0..32ba5813a 100644
--- a/web/src/utils/resource.ts
+++ b/web/src/utils/resource.ts
@@ -2,5 +2,5 @@ export const getResourceUrl = (resource: Resource, withOrigin = true) => {
if (resource.externalLink) {
return resource.externalLink;
}
- return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${encodeURI(resource.filename)}`;
+ return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${encodeURIComponent(resource.filename)}`;
};