fix issue with encode/decode path string

This commit is contained in:
lamacchinadesiderante 2024-04-28 15:24:21 +02:00
parent ab9f048f87
commit 4102fd1ef9
1 changed files with 2 additions and 2 deletions

View File

@ -51,9 +51,9 @@ export const removeHttpS = (url: string): string => {
};
export const encodeVideoUrlPath = (input: string): string => {
return input.replace(/^\/+/, '').replace(/\/+$/, '').replace(/\//g, "-");
return encodeURIComponent(input.replace(/^\/+/, ''))
};
export const decodeVideoUrlPath = (input: string): string => {
return `/${input.replace(/^\-+/, '').replace(/\-+$/, '').replace(/\-/g, "/")}`;
return `/${decodeURIComponent(input)}`;
};