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

main
Cizz22 4 weeks ago
parent abb7e8d27b
commit 1329d5b85d

@ -38,6 +38,13 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
status_code=400, status_code=400,
detail=f"Invalid filename: {str(e)}" 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 # Get filename
filename_without_ext = os.path.splitext(clean_filename)[0] filename_without_ext = os.path.splitext(clean_filename)[0]

Loading…
Cancel
Save