mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Parse Slack hostname
* Allow Mattermost notifications using Slack config
This commit is contained in:
parent
50e29efdfe
commit
c3b0aef1ef
1 changed files with 5 additions and 4 deletions
|
@ -2010,11 +2010,12 @@ class SLACK(object):
|
||||||
|
|
||||||
data['attachments'] = [attachment]
|
data['attachments'] = [attachment]
|
||||||
|
|
||||||
url = urlparse(self.slack_hook).path
|
slackhost = urlparse(self.slack_hook).hostname
|
||||||
|
slackpath = urlparse(self.slack_hook).path
|
||||||
|
|
||||||
http_handler = HTTPSConnection("hooks.slack.com")
|
http_handler = HTTPSConnection(slackhost)
|
||||||
http_handler.request("POST",
|
http_handler.request("POST",
|
||||||
url,
|
slackpath,
|
||||||
headers={'Content-type': "application/x-www-form-urlencoded"},
|
headers={'Content-type': "application/x-www-form-urlencoded"},
|
||||||
body=json.dumps(data))
|
body=json.dumps(data))
|
||||||
|
|
||||||
|
@ -2798,7 +2799,7 @@ class HIPCHAT(object):
|
||||||
|
|
||||||
http_handler = HTTPSConnection(hiphost)
|
http_handler = HTTPSConnection(hiphost)
|
||||||
http_handler.request("POST",
|
http_handler.request("POST",
|
||||||
"%s" % (hipfullq),
|
hipfullq,
|
||||||
headers={'Content-type': "application/json"},
|
headers={'Content-type': "application/json"},
|
||||||
body=json.dumps(data))
|
body=json.dumps(data))
|
||||||
response = http_handler.getresponse()
|
response = http_handler.getresponse()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue