Allow files starting with ~ in directory listings
This commit is contained in:
parent
6c414ca9d4
commit
97ec9918f7
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue