mirror of
https://github.com/caronc/apprise.git
synced 2025-02-08 06:21:06 +01:00
Correctly handle Matrix URLs that do not define a port (#900)
This commit is contained in:
parent
2b57c5dc34
commit
4cda4bf59e
@ -991,11 +991,11 @@ class NotifyMatrix(NotifyBase):
|
|||||||
default_port = 443 if self.secure else 80
|
default_port = 443 if self.secure else 80
|
||||||
|
|
||||||
url = \
|
url = \
|
||||||
'{schema}://{hostname}:{port}{matrix_api}{path}'.format(
|
'{schema}://{hostname}{port}{matrix_api}{path}'.format(
|
||||||
schema='https' if self.secure else 'http',
|
schema='https' if self.secure else 'http',
|
||||||
hostname=self.host,
|
hostname=self.host,
|
||||||
port='' if self.port is None
|
port='' if self.port is None
|
||||||
or self.port == default_port else self.port,
|
or self.port == default_port else f':{self.port}',
|
||||||
matrix_api=MATRIX_V2_API_PATH,
|
matrix_api=MATRIX_V2_API_PATH,
|
||||||
path=path)
|
path=path)
|
||||||
|
|
||||||
@ -1031,6 +1031,7 @@ class NotifyMatrix(NotifyBase):
|
|||||||
timeout=self.request_timeout,
|
timeout=self.request_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.logger.debug('Matrix Response: %s' % str(r.content))
|
||||||
response = loads(r.content)
|
response = loads(r.content)
|
||||||
|
|
||||||
if r.status_code == 429:
|
if r.status_code == 429:
|
||||||
|
Loading…
Reference in New Issue
Block a user