mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Validate bedrock url before download with urllib
Even though there will be an incredibly small chance of tampering this is to make bandit happy "Bandit Test ID B310" https://stackoverflow.com/a/53040523/18355876
This commit is contained in:
parent
0c9e10f18a
commit
96c4fa3bdd
@ -1115,10 +1115,13 @@ class ServerInstance:
|
||||
)
|
||||
else:
|
||||
# downloads zip from remote url
|
||||
urllib.request.urlretrieve(
|
||||
Helpers.get_latest_bedrock_url(),
|
||||
os.path.join(self.settings["path"], "bedrock_server.zip"),
|
||||
)
|
||||
bedrock_url = Helpers.get_latest_bedrock_url()
|
||||
if bedrock_url.lower().startswith("https"):
|
||||
urllib.request.urlretrieve(
|
||||
bedrock_url,
|
||||
os.path.join(self.settings["path"], "bedrock_server.zip"),
|
||||
)
|
||||
|
||||
unzip_path = os.path.join(self.settings["path"], "bedrock_server.zip")
|
||||
unzip_path = self.helper.wtol_path(unzip_path)
|
||||
# unzips archive that was downloaded.
|
||||
|
Loading…
Reference in New Issue
Block a user