feat: validate uploaded file content type is application/octet-stream

main
Cizz22 4 weeks ago
parent abb7e8d27b
commit 1329d5b85d

@ -39,6 +39,13 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
detail=f"Invalid filename: {str(e)}"
)
# Check if mime type is application/octet-stream
if file.content_type != "application/octet-stream":
raise HTTPException(
status_code=400,
detail="Invalid file type. Allowed: application/octet-stream"
)
# Get filename
filename_without_ext = os.path.splitext(clean_filename)[0]

Loading…
Cancel
Save