file_manager: strip leading slashes supplied in the upload path argument

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-09-14 14:43:00 -04:00
parent 8ca953f55c
commit 776e0d6c90
1 changed files with 1 additions and 1 deletions

View File

@ -443,7 +443,7 @@ class FileManager:
if root not in self.file_paths:
raise self.server.error(f"Root {root} not available")
root_path = self.file_paths[root]
dir_path: str = upload_args.get('path', "")
dir_path: str = upload_args.get('path', "").lstrip("/")
if os.path.isfile(root_path):
filename: str = os.path.basename(root_path)
dest_path = root_path