fix: handle uploads of filenames that require uri encoding

This commit is contained in:
Andy Burke 2025-08-12 15:24:55 -07:00
parent a9f3fd9167
commit 278a39a47b
3 changed files with 94 additions and 2 deletions

View file

@ -124,7 +124,7 @@ export const HANDLERS: Partial<Record<HTTP_METHOD, HANDLER_METHOD>> = {
}
for await (const file of files) {
const filename: string = file.name ?? path.basename(normalized_path);
const filename: string = file.name ? decodeURIComponent(file.name) : path.basename(normalized_path);
const resolved_upload_name = path.resolve(path.join(upload_directory, filename));
if (!resolved_upload_name.startsWith(root)) {