From 4102fd1ef9c9970d71138bb9b46d6a2eb663a0e4 Mon Sep 17 00:00:00 2001 From: lamacchinadesiderante Date: Sun, 28 Apr 2024 15:24:21 +0200 Subject: [PATCH] fix issue with encode/decode path string --- src/utils/string.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/string.ts b/src/utils/string.ts index ca19bef..a1c0225 100644 --- a/src/utils/string.ts +++ b/src/utils/string.ts @@ -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)}`; }; \ No newline at end of file