mirror of
https://github.com/caronc/apprise.git
synced 2025-06-25 04:01:26 +02:00
requests timeouts are now enforced (#255)
This commit is contained in:
parent
3c8b06667b
commit
89336f8105
@ -98,6 +98,16 @@ class URLBase(object):
|
|||||||
# Throttle
|
# Throttle
|
||||||
request_rate_per_sec = 0
|
request_rate_per_sec = 0
|
||||||
|
|
||||||
|
# The connect timeout is the number of seconds Requests will wait for your
|
||||||
|
# client to establish a connection to a remote machine (corresponding to
|
||||||
|
# the connect()) call on the socket.
|
||||||
|
request_connect_timeout = 4.0
|
||||||
|
|
||||||
|
# The read timeout is the number of seconds the client will wait for the
|
||||||
|
# server to send a response.
|
||||||
|
request_read_timeout = 2.5
|
||||||
|
|
||||||
|
# Handle
|
||||||
# Maintain a set of tags to associate with this specific notification
|
# Maintain a set of tags to associate with this specific notification
|
||||||
tags = set()
|
tags = set()
|
||||||
|
|
||||||
@ -466,6 +476,13 @@ class URLBase(object):
|
|||||||
def app_url(self):
|
def app_url(self):
|
||||||
return self.asset.app_url
|
return self.asset.app_url
|
||||||
|
|
||||||
|
@property
|
||||||
|
def request_timeout(self):
|
||||||
|
"""This is primarily used to fullfill the `timeout` keyword argument
|
||||||
|
that is used by requests.get() and requests.put() calls.
|
||||||
|
"""
|
||||||
|
return (self.request_connect_timeout, self.request_read_timeout)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_url(url, verify_host=True):
|
def parse_url(url, verify_host=True):
|
||||||
"""Parses the URL and returns it broken apart into a dictionary.
|
"""Parses the URL and returns it broken apart into a dictionary.
|
||||||
|
@ -47,10 +47,6 @@ class AttachHTTP(AttachBase):
|
|||||||
# The default secure protocol
|
# The default secure protocol
|
||||||
secure_protocol = 'https'
|
secure_protocol = 'https'
|
||||||
|
|
||||||
# The maximum number of seconds to wait for a connection to be established
|
|
||||||
# before out-right just giving up
|
|
||||||
connection_timeout_sec = 5.0
|
|
||||||
|
|
||||||
# The number of bytes in memory to read from the remote source at a time
|
# The number of bytes in memory to read from the remote source at a time
|
||||||
chunk_size = 8192
|
chunk_size = 8192
|
||||||
|
|
||||||
@ -129,7 +125,7 @@ class AttachHTTP(AttachBase):
|
|||||||
auth=auth,
|
auth=auth,
|
||||||
params=self.qsd,
|
params=self.qsd,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
timeout=self.connection_timeout_sec,
|
timeout=self.request_timeout,
|
||||||
stream=True) as r:
|
stream=True) as r:
|
||||||
|
|
||||||
# Handle Errors
|
# Handle Errors
|
||||||
|
@ -58,10 +58,6 @@ class ConfigHTTP(ConfigBase):
|
|||||||
# The default secure protocol
|
# The default secure protocol
|
||||||
secure_protocol = 'https'
|
secure_protocol = 'https'
|
||||||
|
|
||||||
# The maximum number of seconds to wait for a connection to be established
|
|
||||||
# before out-right just giving up
|
|
||||||
connection_timeout_sec = 5.0
|
|
||||||
|
|
||||||
# If an HTTP error occurs, define the number of characters you still want
|
# If an HTTP error occurs, define the number of characters you still want
|
||||||
# to read back. This is useful for debugging purposes, but nothing else.
|
# to read back. This is useful for debugging purposes, but nothing else.
|
||||||
# The idea behind enforcing this kind of restriction is to prevent abuse
|
# The idea behind enforcing this kind of restriction is to prevent abuse
|
||||||
@ -185,7 +181,7 @@ class ConfigHTTP(ConfigBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
timeout=self.connection_timeout_sec,
|
timeout=self.request_timeout,
|
||||||
stream=True) as r:
|
stream=True) as r:
|
||||||
|
|
||||||
# Handle Errors
|
# Handle Errors
|
||||||
|
@ -279,6 +279,7 @@ class NotifyBoxcar(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Boxcar returns 201 (Created) when successful
|
# Boxcar returns 201 (Created) when successful
|
||||||
|
@ -221,6 +221,7 @@ class NotifyClickSend(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -304,6 +304,7 @@ class NotifyD7Networks(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
|
@ -353,6 +353,7 @@ class NotifyDiscord(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
files=files,
|
files=files,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
requests.codes.ok, requests.codes.no_content):
|
requests.codes.ok, requests.codes.no_content):
|
||||||
|
@ -207,6 +207,7 @@ class NotifyEmby(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
@ -370,6 +371,7 @@ class NotifyEmby(NotifyBase):
|
|||||||
url,
|
url,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
@ -449,6 +451,7 @@ class NotifyEmby(NotifyBase):
|
|||||||
url,
|
url,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
@ -550,6 +553,7 @@ class NotifyEmby(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
requests.codes.ok,
|
requests.codes.ok,
|
||||||
|
@ -269,6 +269,7 @@ class NotifyEnigma2(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -131,6 +131,7 @@ class NotifyFaast(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -269,6 +269,7 @@ class NotifyFlock(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -309,6 +309,7 @@ class NotifyGitter(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -80,9 +80,10 @@ class NotifyGotify(NotifyBase):
|
|||||||
# Disable throttle rate
|
# Disable throttle rate
|
||||||
request_rate_per_sec = 0
|
request_rate_per_sec = 0
|
||||||
|
|
||||||
# If no bytes have been received on the underlining socket for
|
# The connect timeout is the number of seconds Requests will wait for your
|
||||||
# connection_timeout seconds, close the connection.
|
# client to establish a connection to a remote machine (corresponding to
|
||||||
connection_timeout = 2.5
|
# the connect()) call on the socket.
|
||||||
|
request_connect_timeout = 2.5
|
||||||
|
|
||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
@ -195,7 +196,7 @@ class NotifyGotify(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
timeout=self.connection_timeout,
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -242,6 +242,7 @@ class NotifyIFTTT(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
self.logger.debug(
|
self.logger.debug(
|
||||||
u"IFTTT HTTP response headers: %r" % r.headers)
|
u"IFTTT HTTP response headers: %r" % r.headers)
|
||||||
|
@ -215,6 +215,7 @@ class NotifyJSON(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -280,6 +280,7 @@ class NotifyJoin(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -263,6 +263,7 @@ class NotifyKavenegar(NotifyBase):
|
|||||||
params=payload,
|
params=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
|
@ -163,6 +163,7 @@ class NotifyKumulos(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -276,6 +276,7 @@ class NotifyMSG91(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -240,6 +240,7 @@ class NotifyMSTeams(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -269,6 +269,7 @@ class NotifyMailgun(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -319,6 +319,7 @@ class NotifyMatrix(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
@ -927,6 +928,7 @@ class NotifyMatrix(NotifyBase):
|
|||||||
params=params,
|
params=params,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
response = loads(r.content)
|
response = loads(r.content)
|
||||||
|
@ -227,6 +227,7 @@ class NotifyMatterMost(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -234,6 +234,7 @@ class NotifyMessageBird(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Sample output of a successful transmission
|
# Sample output of a successful transmission
|
||||||
|
@ -280,6 +280,7 @@ class NotifyNexmo(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -185,6 +185,7 @@ class NotifyNextcloud(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -228,6 +228,7 @@ class NotifyNotica(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -288,6 +288,7 @@ class NotifyNotifico(NotifyBase):
|
|||||||
params=payload,
|
params=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -402,6 +402,7 @@ class NotifyOffice365(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
|
@ -191,6 +191,7 @@ class NotifyProwl(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -315,6 +315,7 @@ class NotifyPushBullet(NotifyBase):
|
|||||||
files=files,
|
files=files,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -693,6 +693,7 @@ class NotifyPushSafer(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -267,6 +267,7 @@ class NotifyPushed(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -199,6 +199,7 @@ class NotifyPushjet(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -434,6 +434,7 @@ class NotifyPushover(NotifyBase):
|
|||||||
files=files,
|
files=files,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -476,6 +476,7 @@ class NotifyRocketChat(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
@ -529,6 +530,7 @@ class NotifyRocketChat(NotifyBase):
|
|||||||
api_url,
|
api_url,
|
||||||
data=payload,
|
data=payload,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
@ -595,6 +597,7 @@ class NotifyRocketChat(NotifyBase):
|
|||||||
api_url,
|
api_url,
|
||||||
headers=self.headers,
|
headers=self.headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -236,6 +236,7 @@ class NotifyRyver(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -342,6 +342,7 @@ class NotifySNS(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -361,6 +361,7 @@ class NotifySendGrid(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
requests.codes.ok, requests.codes.accepted):
|
requests.codes.ok, requests.codes.accepted):
|
||||||
|
@ -236,6 +236,7 @@ class NotifySimplePush(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Get our SimplePush response (if it's possible)
|
# Get our SimplePush response (if it's possible)
|
||||||
|
@ -322,6 +322,7 @@ class NotifySinch(NotifyBase):
|
|||||||
data=json.dumps(payload),
|
data=json.dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
# The responsne might look like:
|
# The responsne might look like:
|
||||||
|
@ -505,6 +505,7 @@ class NotifySlack(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
files=files,
|
files=files,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -145,6 +145,7 @@ class NotifyTechulusPush(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
requests.codes.ok, requests.codes.no_content):
|
requests.codes.ok, requests.codes.no_content):
|
||||||
|
@ -325,6 +325,7 @@ class NotifyTelegram(NotifyBase):
|
|||||||
files=files,
|
files=files,
|
||||||
data=payload,
|
data=payload,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
@ -393,6 +394,7 @@ class NotifyTelegram(NotifyBase):
|
|||||||
url,
|
url,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
@ -597,6 +599,7 @@ class NotifyTelegram(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
|
@ -304,6 +304,7 @@ class NotifyTwilio(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
|
@ -640,7 +640,9 @@ class NotifyTwist(NotifyBase):
|
|||||||
api_url,
|
api_url,
|
||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate)
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
|
)
|
||||||
|
|
||||||
# Get our JSON content if it's possible
|
# Get our JSON content if it's possible
|
||||||
try:
|
try:
|
||||||
@ -679,7 +681,9 @@ class NotifyTwist(NotifyBase):
|
|||||||
api_url,
|
api_url,
|
||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate)
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout
|
||||||
|
)
|
||||||
|
|
||||||
# Get our JSON content if it's possible
|
# Get our JSON content if it's possible
|
||||||
try:
|
try:
|
||||||
|
@ -510,7 +510,9 @@ class NotifyTwitter(NotifyBase):
|
|||||||
data=payload,
|
data=payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate)
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
|
)
|
||||||
|
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -168,6 +168,7 @@ class NotifyWebexTeams(NotifyBase):
|
|||||||
data=dumps(payload),
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code not in (
|
if r.status_code not in (
|
||||||
requests.codes.ok, requests.codes.no_content):
|
requests.codes.ok, requests.codes.no_content):
|
||||||
|
@ -264,6 +264,7 @@ class NotifyXBMC(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -234,6 +234,7 @@ class NotifyXML(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
@ -284,6 +284,7 @@ class NotifyZulip(NotifyBase):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
if r.status_code != requests.codes.ok:
|
if r.status_code != requests.codes.ok:
|
||||||
# We had a problem
|
# We had a problem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user