From 0901d3188a0d1095d166829f69b67944e3d548e8 Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Sun, 31 Jul 2022 12:54:42 +0300 Subject: [PATCH] Use path.parts instead of match (#2508) --- sanic/mixins/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/mixins/routes.py b/sanic/mixins/routes.py index efb522f4..328d0b49 100644 --- a/sanic/mixins/routes.py +++ b/sanic/mixins/routes.py @@ -818,7 +818,7 @@ class RouteMixin(metaclass=SanicMeta): 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__}"