v1.0.162: /api/classify-batch + batch_id UUID validation
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user