aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-06-19 11:33:37 +0300
committerGravatar Vitaly Takmazov2019-06-19 11:33:37 +0300
commit6ac759abe3ac2c576af441f588caf01621976576 (patch)
treec08a1cd4a3a73dfcef5669a16f155dd46683cea1 /src/main/java
parentebfe5808daf09644167dc6c10e37e5001453f3be (diff)
Telegram: unescape update data for logger
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java b/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java
index 3301d60a..e2f40a18 100644
--- a/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java
+++ b/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java
@@ -21,6 +21,7 @@ import com.juick.server.TelegramBotManager;
import com.pengrad.telegrambot.BotUtils;
import com.pengrad.telegrambot.model.Update;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -50,7 +51,7 @@ public class TelegramWebhook {
@ResponseStatus(value = HttpStatus.OK)
public void processUpdate(InputStream body) throws Exception {
String data = IOUtils.toString(body, StandardCharsets.UTF_8);
- logger.debug("Telegram update: {}", data);
+ logger.debug("Telegram update: {}", StringEscapeUtils.unescapeJava(data));
Update update = BotUtils.parseUpdate(data);
telegramBotManager.processUpdate(update);
}