From 60e012f75b6e3efbb02ebddf0a6ac175131541c1 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 25 Jul 2016 12:44:41 -0400 Subject: [PATCH] Force requests to emit application/json When sending webhook notifications --- awx/main/notifications/webhook_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/notifications/webhook_backend.py b/awx/main/notifications/webhook_backend.py index fbefe78037..fe887efc68 100644 --- a/awx/main/notifications/webhook_backend.py +++ b/awx/main/notifications/webhook_backend.py @@ -32,7 +32,7 @@ class WebhookBackend(TowerBaseEmailBackend): self.headers['User-Agent'] = "Tower {}".format(get_awx_version()) for m in messages: r = requests.post("{}".format(m.recipients()[0]), - data=json.dumps(m.body), + json=m.body, headers=self.headers) if r.status_code >= 400: logger.error(smart_text("Error sending notification webhook: {}".format(r.text)))