diff --git a/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs b/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs index 95fe79b12..0c83567ef 100644 --- a/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs +++ b/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs @@ -89,6 +89,10 @@ namespace NzbDrone.Common.Test.InstrumentationTests [TestCase(@"https://discord.com/api/webhooks/mySecret")] [TestCase(@"https://discord.com/api/webhooks/mySecret/01233210")] + // Telegram + [TestCase(@"https://api.telegram.org/bot1234567890:mySecret/sendmessage: chat_id=123456&parse_mode=HTML&text=")] + [TestCase(@"https://api.telegram.org/bot1234567890:mySecret/")] + public void should_clean_message(string message) { var cleansedMessage = CleanseLogMessage.Cleanse(message); diff --git a/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs b/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs index 417e802ec..4bc0e00dc 100644 --- a/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs +++ b/src/NzbDrone.Common/Instrumentation/CleanseLogMessage.cs @@ -54,7 +54,10 @@ namespace NzbDrone.Common.Instrumentation new (@"api/v[0-9]/notification/readarr/(?[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), // Discord - new (@"discord.com/api/webhooks/((?[\w-]+)/)?(?[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase) + new (@"discord.com/api/webhooks/((?[\w-]+)/)?(?[\w-]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase), + + // Telegram + new (@"api.telegram.org/bot(?[\d]+):(?[\w-]+)/", RegexOptions.Compiled | RegexOptions.IgnoreCase) }; private static readonly Regex CleanseRemoteIPRegex = new (@"(?:Auth-\w+(?