Skip to content

Commit

Permalink
Merge pull request #651 from JakubOnderka/fix-json
Browse files Browse the repository at this point in the history
Fix json
  • Loading branch information
JakubOnderka authored Jan 9, 2024
2 parents 1ceda39 + c6d5e19 commit 66c0cec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Run server in background
run: |
misp-modules -l 127.0.0.1 -s 2>error.log &
sleep 5
sleep 3
- name: Check if server is running
run: |
curl -sS localhost:6666/healthcheck
Expand Down
6 changes: 5 additions & 1 deletion misp_modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from tornado.ioloop import IOLoop
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
from pymisp import pymisp_json_default

try:
from .modules import * # noqa
Expand Down Expand Up @@ -202,7 +203,7 @@ def run_request(self, module_name, json_payload, dict_payload):
response = module.dict_handler(request=dict_payload)
else:
response = module.handler(q=json_payload)
return json.dumps(response)
return json.dumps(response, default=pymisp_json_default)

@tornado.gen.coroutine
def post(self):
Expand Down Expand Up @@ -303,6 +304,9 @@ def main():
return 1
print(e)
print("misp-modules might still be running.")
else:
log.exception(f"Could not listen on {args.listen}:{args.port}")
return 1

log.info(f'MISP modules server started on {args.listen} port {args.port}')
if args.test:
Expand Down

0 comments on commit 66c0cec

Please sign in to comment.