From 6ac759abe3ac2c576af441f588caf01621976576 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 19 Jun 2019 11:33:37 +0300 Subject: Telegram: unescape update data for logger --- src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3