diff --git a/lib/http-listener.js b/lib/http-listener.js index a57002c..4d9544f 100644 --- a/lib/http-listener.js +++ b/lib/http-listener.js @@ -69,8 +69,16 @@ function mainHandler(req, res) { ( req.body.is_outgoing || req.query.is_outgoing ) ? messagesArchive.DIRECTION_OUTGOING : messagesArchive.DIRECTION_INCOMING ); - if (req.body.do_not_forward_to_core || req.query.do_not_forward_to_core || req.body.is_outgoing || req.query.is_outgoing) { - logger.verbose('Ignoring message', { from: req.body.from || req.query.from, msg: req.body.msg || req.query.msg, do_not_forward_to_core: req.body.do_not_forward_to_core || req.query.do_not_forward_to_core }); + if ( + req.body.do_not_forward_to_core || req.query.do_not_forward_to_core + || req.body.is_outgoing || req.query.is_outgoing + ) { + logger.verbose( 'Ignoring message', { + from: req.body.from || req.query.from, + msg: req.body.msg || req.query.msg, + do_not_forward_to_core: req.body.do_not_forward_to_core || req.query.do_not_forward_to_core + }); + res.end('OK'); return; }