mirror of
https://github.com/9001/copyparty.git
synced 2025-08-16 08:32:13 -06:00
wget: only allow http/https/ftp/ftps (#50):
these are all the protocols that are currently supported by wget, so this has no practical effect aside from making sure we won't suddenly get file:// support or something (which would be bad)
This commit is contained in:
parent
8341041857
commit
7df890d964
|
@ -37,6 +37,10 @@ def main():
|
|||
if "://" not in url:
|
||||
url = "https://" + url
|
||||
|
||||
proto = url.split("://")[0].lower()
|
||||
if proto not in ("http", "https", "ftp", "ftps"):
|
||||
raise Exception("bad proto {}".format(proto))
|
||||
|
||||
os.chdir(inf["ap"])
|
||||
|
||||
name = url.split("?")[0].split("/")[-1]
|
||||
|
|
|
@ -65,6 +65,10 @@ def main():
|
|||
if "://" not in url:
|
||||
url = "https://" + url
|
||||
|
||||
proto = url.split("://")[0].lower()
|
||||
if proto not in ("http", "https", "ftp", "ftps"):
|
||||
raise Exception("bad proto {}".format(proto))
|
||||
|
||||
os.chdir(fdir)
|
||||
|
||||
name = url.split("?")[0].split("/")[-1]
|
||||
|
|
Loading…
Reference in a new issue