From dd3e93681557ed8a8fb4f1bfcc043682144a2987 Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <adhisimon@gmail.com>
Date: Mon, 4 Oct 2021 15:34:18 +0700
Subject: [PATCH] Add config.do_not_reply_warning_on_empty_message

---
 config.sample.json   | 3 ++-
 lib/http-listener.js | 7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/config.sample.json b/config.sample.json
index aa6ab6e..d0aa580 100644
--- a/config.sample.json
+++ b/config.sample.json
@@ -13,5 +13,6 @@
     "ascending_mutation": false,
     "blacklist_help_for_origins": [],
     "blacklist_help_for_origin_transports": [],
-    "disable_claim_bonus": false
+    "disable_claim_bonus": false,
+    "do_not_reply_warning_on_empty_message": false
 }
\ No newline at end of file
diff --git a/lib/http-listener.js b/lib/http-listener.js
index 498b34c..8c4c3d2 100644
--- a/lib/http-listener.js
+++ b/lib/http-listener.js
@@ -70,8 +70,11 @@ function mainHandler(req, res) {
         logger.warn(`${MODULE_NAME} #92996A497D12: Undefined parameter msg`, {
             xid,
         });
-        res.end(`ERROR. Undefined parameter: msg. XID: ${xid}`);
-        return;
+
+        if (!config.do_not_reply_warning_on_empty_message) {
+            res.end(`ERROR. Undefined parameter: msg. XID: ${xid}`);
+            return;
+        }
     }
 
     logger.verbose(
-- 
1.9.0