Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion vulnerabilities/pipelines/enhance_with_exploitdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,16 @@ def add_exploit_references(ref_id, direct_url, path, vul_id, logger):
"direct_url": direct_url,
}

MAX_REF_LEN = 200
safe_ref_id = ref_id[:MAX_REF_LEN] if ref_id else ref_id
Comment on lines +131 to +132
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add "..." at the end of the truncated text to indicate that it has been shortened?


for key, url in url_map.items():
if url:
try:
ref, created = VulnerabilityReference.objects.update_or_create(
url=url,
defaults={
"reference_id": ref_id,
"reference_id": safe_ref_id,
"reference_type": VulnerabilityReference.EXPLOIT,
},
)
Expand Down