🚑 Regex was after downloading (security issue)

This commit is contained in:
Mawoka
2022-04-02 20:20:59 +02:00
parent 385f8be1da
commit 0bad308c9c
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ class Storage:
if backend == "deta":
if deta_key is None or deta_id is None:
raise ValueError("deta_key and deta_id must be provided")
if backend == "local":
elif backend == "local":
if storage_path is None:
raise ValueError("storage_path must be provided")
else:
+8
View File
@@ -41,3 +41,11 @@ class DetaStorage:
return None
else:
raise Exception("Upload failed")
async def delete(self, file_name: [str]) -> None:
async with ClientSession(headers=self.headers) as session:
async with session.delete(f"{self.deta_url}/files/delete", data={"names": file_name}) as response:
if response.status == 200:
return None
else:
raise Exception("Delete failed")