From ea51b1e95e0430d7128bc055a02e19f543172267 Mon Sep 17 00:00:00 2001 From: Robin Modisch Date: Sun, 17 Jan 2021 01:06:47 +0100 Subject: [PATCH] hide token from debug logs prevent leaks of the bot token by hiding it from the log --- telebot/apihelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 2a42318..27d3c95 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -73,7 +73,7 @@ def _make_request(token, method_name, method='get', params=None, files=None): else: request_url = "https://api.telegram.org/bot{0}/{1}".format(token, method_name) - logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files)) + logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files).replace(token, "{TOKEN}")) read_timeout = READ_TIMEOUT connect_timeout = CONNECT_TIMEOUT if files and format_header_param: