From 88f61f9bdb9093abb05ff1c70c5a0d3153c91cf5 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Wed, 10 Dec 2025 17:24:31 +0100 Subject: [PATCH] Added filename check --- cognee/api/v1/ontologies/ontologies.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cognee/api/v1/ontologies/ontologies.py b/cognee/api/v1/ontologies/ontologies.py index cfd42fec4..2a133bf8a 100644 --- a/cognee/api/v1/ontologies/ontologies.py +++ b/cognee/api/v1/ontologies/ontologies.py @@ -48,6 +48,8 @@ class OntologyService: async def upload_ontology( self, ontology_key: str, file: UploadFile, user, description: Optional[str] = None ) -> OntologyMetadata: + if not file.filename: + raise ValueError("File must have a filename") if not file.filename.lower().endswith(".owl"): raise ValueError("File must be in .owl format")