diff --git a/routes/dir/[...path].tsx b/routes/dir/[...path].tsx index 67eb82e..c8d8a4b 100644 --- a/routes/dir/[...path].tsx +++ b/routes/dir/[...path].tsx @@ -36,7 +36,7 @@ async function GET(req: Request, ctx: HandlerContext): Promise{ } } const url = new URL(req.url); - const path = removePrefixFromPathname(url.pathname, "/dir"); + const path = removePrefixFromPathname(decodeURI(url.pathname), "/dir"); const stat = await Deno.stat(path); if (stat.isDirectory){ const filesIter = await Deno.readDir(path); diff --git a/routes/fs/[...path].ts b/routes/fs/[...path].ts index 8741b0d..fdd91c7 100644 --- a/routes/fs/[...path].ts +++ b/routes/fs/[...path].ts @@ -4,7 +4,7 @@ import {removePrefixFromPathname} from "../../util/util.ts"; export async function GET(req: Request, ctx: HandlerContext): Promise { const url = new URL(req.url); - const path = removePrefixFromPathname(url.pathname, "/fs"); + const path = removePrefixFromPathname(decodeURI(url.pathname), "/fs"); // if auth is required, check if the user is logged in. // if not, return a 401. const authRequired = Deno.env.get("AUTH_REQUIRED") === "true";