fix url decode
This commit is contained in:
parent
2726e2abaf
commit
d959076d28
@ -36,7 +36,7 @@ async function GET(req: Request, ctx: HandlerContext): Promise<Response>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const url = new URL(req.url);
|
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);
|
const stat = await Deno.stat(path);
|
||||||
if (stat.isDirectory){
|
if (stat.isDirectory){
|
||||||
const filesIter = await Deno.readDir(path);
|
const filesIter = await Deno.readDir(path);
|
||||||
|
@ -4,7 +4,7 @@ import {removePrefixFromPathname} from "../../util/util.ts";
|
|||||||
|
|
||||||
export async function GET(req: Request, ctx: HandlerContext): Promise<Response> {
|
export async function GET(req: Request, ctx: HandlerContext): Promise<Response> {
|
||||||
const url = new URL(req.url);
|
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 auth is required, check if the user is logged in.
|
||||||
// if not, return a 401.
|
// if not, return a 401.
|
||||||
const authRequired = Deno.env.get("AUTH_REQUIRED") === "true";
|
const authRequired = Deno.env.get("AUTH_REQUIRED") === "true";
|
||||||
|
Loading…
Reference in New Issue
Block a user