Fix tests.

This commit is contained in:
grossmj committed 2021-05-15 19:43:36 +09:30
1 parent 6294ad9e76
commit 9a6978902d
7 files changed
+36 -23

No files matched your search

+1 -2
View File
@@ -43,8 +43,7 @@ def is_safe_path(file_path, directory):
(the file is stored inside directory or one of its sub-directory)
"""
requested_path = os.path.relpath(file_path, start=directory)
requested_path = os.path.abspath(requested_path)
requested_path = os.path.abspath(file_path)
common_prefix = os.path.commonprefix([requested_path, directory])
return common_prefix != directory