fix: Binary content blocks were messing everything

pull/22/head
Hannah Ward 2017-10-19 16:31:06 +01:00
parent 66c0c329d9
commit 3854d829e1
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import pymisp
import tempfile
import logging
from pyaml import yaml
from io import StringIO
log = logging.getLogger("__main__")
@ -54,7 +55,7 @@ def post_stix(manager, content_block, collection_ids, service_id):
# Load the package
log.info("Posting STIX...")
package = pymisp.tools.stix.load_stix(content_block.content)
package = pymisp.tools.stix.load_stix(StringIO(content_block.content.decode()))
log.info("STIX loaded succesfully.")
values = [x.value for x in package.attributes]
log.info("Extracted %s", values)