remove double validation
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s
This commit is contained in:
@@ -455,10 +455,6 @@ async def upload_script(
|
|||||||
logger.warning("Invalid name provided: %s", name)
|
logger.warning("Invalid name provided: %s", name)
|
||||||
raise HTTPException(status_code=400, detail=str(e))
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
|
|
||||||
if not script.filename.endswith(".py"):
|
|
||||||
logger.warning("Upload rejected: script not .py (name=%s original=%s)", name, script.filename)
|
|
||||||
raise HTTPException(status_code=400, detail="only .py scripts allowed")
|
|
||||||
|
|
||||||
spath = script_path_for(name)
|
spath = script_path_for(name)
|
||||||
if os.path.exists(spath):
|
if os.path.exists(spath):
|
||||||
logger.warning("Upload rejected: script with name already exists: %s", name)
|
logger.warning("Upload rejected: script with name already exists: %s", name)
|
||||||
|
|||||||
Reference in New Issue
Block a user