v1.0.162: /api/classify-batch + batch_id UUID validation

This commit is contained in:
2026-06-24 08:23:40 +04:00
parent 7a96f5b95b
commit eb98790802
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -32,6 +32,12 @@ def handle_upload(rfile, content_type, content_length):
contract_id = fs.getfirst("contract_id", "")
batch_id = fs.getfirst("batch_id", None) if "batch_id" in fs else None
# Validate UUID
if batch_id:
try:
uuid.UUID(batch_id)
except (ValueError, AttributeError):
batch_id = None
if not filename or not file_data:
return {"ok": False, "error": "no file in request"}