Allow files starting with ~ in directory listings

This commit is contained in:
Michael Lazar 2020-01-12 14:03:37 -05:00
parent 6c414ca9d4
commit 97ec9918f7
1 changed files with 2 additions and 2 deletions

View File

@ -310,8 +310,8 @@ class StaticDirectoryApplication(JetforceApplication):
yield f"=>/{url_path.parent}\t..\r\n".encode() yield f"=>/{url_path.parent}\t..\r\n".encode()
for file in sorted(filesystem_path.iterdir()): for file in sorted(filesystem_path.iterdir()):
if file.name.startswith((".", "~")): if file.name.startswith("."):
# Skip hidden and temporary files for security reasons # Skip hidden directories/files that may contain sensitive info
continue continue
elif file.is_dir(): elif file.is_dir():
yield f"=>/{url_path / file.name}/\t{file.name}/\r\n".encode() yield f"=>/{url_path / file.name}/\t{file.name}/\r\n".encode()