mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Update webhook_backend.py
At the request via webhook just uses default pre configured headers (with Agent/ContentType) by ignoring at all customer provided headers (self.headers). Thus the OAuth authentication via Bearer cannot be implemented since custom headers are not sent to service so receiving Unauthorized response. Solution is merging the default headers with custom ones (custom headers will override default ones in case of key clash).
This commit is contained in:
parent
9ea6696bf9
commit
24a8653fab
@ -72,7 +72,7 @@ class WebhookBackend(AWXBaseEmailBackend, CustomNotificationBase):
|
||||
"{}".format(m.recipients()[0]),
|
||||
auth=auth,
|
||||
data=json.dumps(m.body, ensure_ascii=False).encode('utf-8'),
|
||||
headers=get_awx_http_client_headers(),
|
||||
headers=dict(list(get_awx_http_client_headers().items()) + list((self.headers or {}).items())),
|
||||
verify=(not self.disable_ssl_verification),
|
||||
)
|
||||
if r.status_code >= 400:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user