Skip to content

Commit 5b1686c

Browse files
committed
Use path.parts instead of match (#2508)
1 parent 86baaef commit 5b1686c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sanic/mixins/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ async def _static_request_handler(
787787
file_path = file_path_raw.resolve()
788788
if (
789789
file_path < root_path and not file_path_raw.is_symlink()
790-
) or file_path_raw.match("../**/*"):
790+
) or ".." in file_path_raw.parts:
791791
error_logger.exception(
792792
f"File not found: path={file_or_directory}, "
793793
f"relative_url={__file_uri__}"

0 commit comments

Comments
 (0)