Skip to content

Commit

Permalink
Use path.parts instead of match (#2508)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Jul 31, 2022
1 parent 0985d13 commit 0901d31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sanic/mixins/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ async def _static_request_handler(
file_path = file_path_raw.resolve()
if (
file_path < root_path and not file_path_raw.is_symlink()
) or file_path_raw.match("../**/*"):
) or ".." in file_path_raw.parts:
error_logger.exception(
f"File not found: path={file_or_directory}, "
f"relative_url={__file_uri__}"
Expand Down

0 comments on commit 0901d31

Please sign in to comment.