Signal supports a HTTP 201 Response (#592)

This commit is contained in:
Chris Caron 2022-05-29 15:08:53 -04:00 committed by GitHub
parent 3ffac7c372
commit 6ac9c1d89a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -320,7 +320,8 @@ class NotifySignalAPI(NotifyBase):
verify=self.verify_certificate, verify=self.verify_certificate,
timeout=self.request_timeout, timeout=self.request_timeout,
) )
if r.status_code != requests.codes.ok: if r.status_code not in (
requests.codes.ok, requests.codes.created):
# We had a problem # We had a problem
status_str = \ status_str = \
NotifySignalAPI.http_response_code_lookup( NotifySignalAPI.http_response_code_lookup(

View File

@ -112,6 +112,11 @@ apprise_url_tests = (
# use get args to acomplish the same thing (use source instead of from) # use get args to acomplish the same thing (use source instead of from)
'instance': plugins.NotifySignalAPI, 'instance': plugins.NotifySignalAPI,
}), }),
('signals://user:password@localhost/{}/{}'.format('1' * 11, '3' * 11), {
'instance': plugins.NotifySignalAPI,
# Test that a 201 response code is still accepted
'requests_response_code': 201,
}),
('signals://localhost/{}/{}/{}?batch=True'.format( ('signals://localhost/{}/{}/{}?batch=True'.format(
'1' * 11, '3' * 11, '4' * 11), { '1' * 11, '3' * 11, '4' * 11), {
# test batch mode # test batch mode