From 69d9497df325b0ea7ef71824f7106ae09fcbcdbb Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 25 Jul 2021 12:17:54 -0400 Subject: [PATCH] webhooks: Remove spaces from json messages sent on api server Reduce the bandwidth slightly by removing unnecessary spaces in messages. Signed-off-by: Kevin O'Connor --- klippy/webhooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/webhooks.py b/klippy/webhooks.py index 2deed429..3865d0d6 100644 --- a/klippy/webhooks.py +++ b/klippy/webhooks.py @@ -237,7 +237,7 @@ class ClientConnection: self.send(result) def send(self, data): - self.send_buffer += json.dumps(data) + "\x03" + self.send_buffer += json.dumps(data, separators=(',', ':')) + "\x03" if not self.is_sending_data: self.is_sending_data = True self.reactor.register_callback(self._do_send)