Fixed data treatment & other updates

pull/156/head
chrisr3d 2018-01-28 18:12:40 +01:00
parent 4d846f968f
commit 56cbd72b65
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ def handler(q=False):
def findDelimiter(header, data):
n = len(header)
if n > 1:
for d in (';', '|', '/', ','):
for d in (';', '|', '/', ',', ' '):
if data[0].count(d) == (n-1):
return d, n
else:
@ -59,7 +59,7 @@ def buildAttributes(header, dataValues, delimiter, length):
if delimiter is None:
mispType = header[0]
for data in dataValues:
attributes.append({'type': mispType, 'value': data})
attributes.append({'type': mispType, 'value': data.strip()})
else:
# split fields that should be recognized as misp attribute types from the others
list2pop, misp, head = findMispTypes(header)
@ -107,7 +107,7 @@ def findMispTypes(header):
else:
head.append(h)
# return list of indexes of the misp types, list of the misp types, remaining fields that will be attribute fields
return list2pop, misp, head
return list2pop, misp, list(reversed(head))
def introspection():
return mispattributes