Merge branch 'master' of github.com:MISP/misp-modules into tests

pull/339/head
chrisr3d 2019-10-07 16:48:26 +02:00
commit bef1cbb8a0
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ except ImportError:
misperrors = {'error': 'Error'} misperrors = {'error': 'Error'}
mispattributes = {'input': ['stix2-pattern'], 'output': ['text']} mispattributes = {'input': ['stix2-pattern'], 'output': ['text']}
moduleinfo = {'version': '0.1', 'author': 'Christian Studer', 'module-type': ['expansion', 'hover'], moduleinfo = {'version': '0.1', 'author': 'Christian Studer', 'module-type': ['hover'],
'description': 'An expansion hover module to perform a syntax check on stix2 patterns.'} 'description': 'An expansion hover module to perform a syntax check on stix2 patterns.'}
moduleconfig = [] moduleconfig = []
@ -20,7 +20,7 @@ def handler(q=False):
return misperrors return misperrors
pattern = request.get('stix2-pattern') pattern = request.get('stix2-pattern')
syntax_errors = [] syntax_errors = []
for p in pattern[2:-2].split(' AND '): for p in pattern[1:-1].split(' AND '):
syntax_validator = run_validator("[{}]".format(p)) syntax_validator = run_validator("[{}]".format(p))
if syntax_validator: if syntax_validator:
for error in syntax_validator: for error in syntax_validator: