Skip to content

Commit

Permalink
Fix: Resolve the issue where the directory itself being a symlink doe…
Browse files Browse the repository at this point in the history
…s not work.
  • Loading branch information
hanxi authored Jul 19, 2024
1 parent 6f863b0 commit 831cb5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlette/staticfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def lookup_path(self, path: str) -> tuple[str, os.stat_result | None]:
full_path = os.path.abspath(joined_path)
else:
full_path = os.path.realpath(joined_path)
directory = os.path.realpath(directory)
directory = os.path.realpath(directory)
if os.path.commonpath([full_path, directory]) != directory:
# Don't allow misbehaving clients to break out of the static files
# directory.
Expand Down

0 comments on commit 831cb5d

Please sign in to comment.