diff --git a/src/robusta/core/sinks/webhook/webhook_sink.py b/src/robusta/core/sinks/webhook/webhook_sink.py index 57b262553..98f96d943 100644 --- a/src/robusta/core/sinks/webhook/webhook_sink.py +++ b/src/robusta/core/sinks/webhook/webhook_sink.py @@ -51,12 +51,12 @@ def write_finding(self, finding: Finding, platform_enabled: bool): {line} """ ) - if len(message) + len(wrapped) >= self.size_limit: + if len(message.encode('utf-8')) + len(wrapped.encode('utf8')) >= self.size_limit: break message += wrapped try: - r = requests.post(self.url, data=message, headers=self.headers) + r = requests.post(self.url, data=message.encode('utf-8'), headers=self.headers) r.raise_for_status() except Exception: logging.exception(f"Webhook request error\n headers: \n{self.headers}")