fix: handle uploads of filenames that require uri encoding
This commit is contained in:
parent
a9f3fd9167
commit
278a39a47b
3 changed files with 94 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue