fix: url encode for tag name (#1031)

pull/1034/head
boojack 2 years ago committed by GitHub
parent 771ef44d82
commit 4de65ab55d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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() {

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

Loading…
Cancel
Save