Skip to content

Commit 9299241

Browse files
committed
Stricter conditions
1 parent 2a8761d commit 9299241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/murfey/server/api/bootstrap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ def get_msys2_setup(setup_file: str):
302302
raise ValueError("Unallowed characters present in requested setup file")
303303

304304
# Allow only '.exe', 'tar.xz', 'tar.zst', or '.sig' files
305-
if not any(setup_file.endswith(ext) for ext in (msys2_file_ext)):
305+
if not setup_file.startswith("msys2") and not any(
306+
setup_file.endswith(ext) for ext in (msys2_file_ext)
307+
):
306308
raise ValueError(f"{setup_file!r} is not a valid executable")
307309

308310
installer = requests.get(f"{msys2_url}/distrib/{setup_file}")

0 commit comments

Comments
 (0)