Skip to content

Commit

Permalink
Correctly handle Matrix URLs that do not define a port (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc authored Jul 6, 2023
1 parent 2b57c5d commit 4cda4bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apprise/plugins/NotifyMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,11 +991,11 @@ def _fetch(self, path, payload=None, params=None, method='POST'):
default_port = 443 if self.secure else 80

url = \
'{schema}://{hostname}:{port}{matrix_api}{path}'.format(
'{schema}://{hostname}{port}{matrix_api}{path}'.format(
schema='https' if self.secure else 'http',
hostname=self.host,
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,
path=path)

Expand Down Expand Up @@ -1031,6 +1031,7 @@ def _fetch(self, path, payload=None, params=None, method='POST'):
timeout=self.request_timeout,
)

self.logger.debug('Matrix Response: %s' % str(r.content))
response = loads(r.content)

if r.status_code == 429:
Expand Down

0 comments on commit 4cda4bf

Please sign in to comment.