mirror of
				https://github.com/9001/copyparty.git
				synced 2025-07-29 09:39:53 +03: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:
		| @@ -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] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ed
					ed