fix: path leading slash and remove unused endpoint
This commit is contained in:
parent
d1abd6684e
commit
51528afc74
12 changed files with 295 additions and 5364 deletions
|
|
@ -111,7 +111,7 @@ async function handleNotFoundRecord(
|
|||
buffer: Buffer,
|
||||
stat: { size: number; type: string },
|
||||
) {
|
||||
const path = pathname.split("/").slice(0, -1).join("/") + "/";
|
||||
const path = stripLeadingSlash(pathname.split("/").slice(0, -1).join("/") + "/");
|
||||
const filename = pathname.split("/").at(-1);
|
||||
const base64 = Buffer.from(buffer).toString("base64");
|
||||
|
||||
|
|
@ -175,3 +175,7 @@ async function handleFoundRecord(
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
function stripLeadingSlash(str: string) {
|
||||
return str.replace(/^\//, "");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue