From 2071cdea32679ecff82d04547ecce05c7d36e247 Mon Sep 17 00:00:00 2001 From: myl7 Date: Mon, 22 Nov 2021 23:50:13 +0800 Subject: [PATCH] add urlencoding for one lost c.name --- components/FileListing.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/FileListing.tsx b/components/FileListing.tsx index 26be464..84d287f 100644 --- a/components/FileListing.tsx +++ b/components/FileListing.tsx @@ -264,7 +264,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) = title="Copy raw file permalink" className="hover:bg-gray-300 dark:hover:bg-gray-600 p-2 rounded cursor-pointer" onClick={() => { - clipboard.copy(`${getBaseUrl()}/api?path=${path === '/' ? '' : path}/${c.name}&raw=true`) + clipboard.copy(`${getBaseUrl()}/api?path=${path === '/' ? '' : path}/${encodeURIComponent(c.name)}&raw=true`) toast.success('Copied raw file permalink.') }} >