diff --git a/platypush/backend/http/app/routes/hook.py b/platypush/backend/http/app/routes/hook.py index 5d9b420cc..e5d3de408 100644 --- a/platypush/backend/http/app/routes/hook.py +++ b/platypush/backend/http/app/routes/hook.py @@ -60,7 +60,7 @@ def hook_route(hook_name): try: send_message(event) - rs = make_response(json.dumps({'status': 'ok', **event_args})) + rs = default_rs = make_response(json.dumps({'status': 'ok', **event_args})) headers = {} status_code = 200 @@ -78,6 +78,10 @@ def hook_route(hook_name): status_code = rs.get('___code___', status_code) rs = rs['___data___'] + if rs is None: + rs = default_rs + headers = {'Content-Type': 'application/json'} + rs = make_response(rs) else: headers = {'Content-Type': 'application/json'}