Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloperezj committed Sep 21, 2024
1 parent aaab412 commit a1849d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _get_indicator_type(item: dict):
def _get_indicator_id(item: dict):
"""Gets indicator ID."""
if item['type'] == 'url':
return item.get('attributes', {}).get('url')
return item.get('attributes', {}).get('url') or item['id']
return item['id']


Expand All @@ -158,7 +158,7 @@ def _add_file_attributes(indicator_obj: dict, attributes: dict) -> dict:
indicator_obj['fields'].update({
'md5': attributes.get('md5'),
'sha1': attributes.get('sha1'),
'sha256': attributes['sha256'],
'sha256': attributes.get('sha256'),
'ssdeep': attributes.get('ssdeep'),
'fileextension': attributes.get('type_extension'),
'filetype': attributes.get('type_tag'),
Expand Down

0 comments on commit a1849d8

Please sign in to comment.