From d32bfe59643e2b6734c2776af56bf11e20d4a421 Mon Sep 17 00:00:00 2001 From: Marcus Young Date: Thu, 13 Feb 2020 12:36:08 -0600 Subject: [PATCH] Add json vs data payloads in webhooks --- tilty/emitters/webhook.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tilty/emitters/webhook.py b/tilty/emitters/webhook.py index 6b8eff3..31d9b6e 100644 --- a/tilty/emitters/webhook.py +++ b/tilty/emitters/webhook.py @@ -26,8 +26,14 @@ def emit(self, **kwargs): # pylint: disable=no-self-use,unused-argument Args: """ - self.method( + if self.headers and 'json' in self.headers.get('Content-Type'): + return self.method( + url=self.url, + headers=self.headers, + json=self.payload, + ) + return self.method( url=self.url, headers=self.headers, - json=self.payload, + data=self.payload, )