Skip to content

Commit

Permalink
fix: Strip every string in AbstractMISP
Browse files Browse the repository at this point in the history
fix #546
  • Loading branch information
Rafiot committed Mar 24, 2020
1 parent c6656a1 commit b5b40ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pymisp/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def to_dict(self) -> dict:
continue
elif isinstance(val, list) and len(val) == 0:
continue
elif isinstance(val, str):
val = val.strip()
if attribute == 'timestamp':
if not self.__force_timestamps and is_edited:
# In order to be accepted by MISP, the timestamp of an object
Expand Down
2 changes: 1 addition & 1 deletion tests/mispevent_testfiles/existing_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@
"uuid": "5a3d0143-c300-4118-8afe-4a2d950d210f"
}
],
"comment": "Win32/Sednit.AX\t",
"comment": "Win32/Sednit.AX",
"deleted": false,
"description": "File object describing a file with meta-information",
"distribution": "5",
Expand Down
2 changes: 1 addition & 1 deletion tests/mispevent_testfiles/existing_event_edited.json
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@
"uuid": "5a3d0143-c300-4118-8afe-4a2d950d210f"
}
],
"comment": "Win32/Sednit.AX\t",
"comment": "Win32/Sednit.AX",
"deleted": false,
"description": "File object describing a file with meta-information",
"distribution": "5",
Expand Down

0 comments on commit b5b40ae

Please sign in to comment.