Skip to content

Commit

Permalink
Make it to be one loop for performance optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihweiLHBird committed Jul 27, 2022
1 parent 448e759 commit 9c8ca36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sanic/mixins/routes.py
Expand Up @@ -815,7 +815,7 @@ async def _static_request_handler(
unquoted_file_uri = unquote(__file_uri__).lstrip("/")

segments = unquoted_file_uri.split("/")
if ".." in segments or any(sep in segment for segment in segments):
if any(segment == ".." or sep in segment for segment in segments):
raise BadRequest("Invalid URL")

file_path = path.join(file_or_directory, unquoted_file_uri)
Expand Down

0 comments on commit 9c8ca36

Please sign in to comment.