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 committed Sep 29, 2024
1 parent 0b50b9c commit 72e5573
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 @@ -155,7 +155,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 72e5573

Please sign in to comment.