diff --git a/federation/hostmeta/parsers.py b/federation/hostmeta/parsers.py index 136db01..b03e198 100644 --- a/federation/hostmeta/parsers.py +++ b/federation/hostmeta/parsers.py @@ -125,9 +125,8 @@ def parse_mastodon_document(doc, host): def parse_matrix_document(doc: Dict, host: str) -> Dict: result = deepcopy(defaults) - host_without_port = host.split(':')[0] - result['host'] = host_without_port - result['name'] = host_without_port + result['host'] = host + result['name'] = host result['protocols'] = ['matrix'] result['platform'] = f'matrix|{doc["server"]["name"].lower()}' result['version'] = doc["server"]["version"] diff --git a/federation/tests/hostmeta/test_parsers.py b/federation/tests/hostmeta/test_parsers.py index acdf9e1..86ed051 100644 --- a/federation/tests/hostmeta/test_parsers.py +++ b/federation/tests/hostmeta/test_parsers.py @@ -119,37 +119,6 @@ class TestParseMastodonDocument: class TestParseMatrixDocument: - @patch('federation.hostmeta.parsers.send_document', autospec=True, return_value=(403, None)) - def test_parse_matrix_document__removes_port_from_host(self, mock_send): - result = parse_matrix_document(json.loads(MATRIX_SYNAPSE_DOC), 'feneas.org:8448') - assert result == { - 'organization': { - 'account': '', - 'contact': '', - 'name': '', - }, - 'host': 'feneas.org', - 'name': 'feneas.org', - 'open_signups': False, - 'protocols': ['matrix'], - 'relay': '', - 'server_meta': {}, - 'services': [], - 'platform': 'matrix|synapse', - 'version': '0.33.8', - 'features': {}, - 'activity': { - 'users': { - 'total': None, - 'half_year': None, - 'monthly': None, - 'weekly': None, - }, - 'local_posts': None, - 'local_comments': None, - }, - } - @patch('federation.hostmeta.parsers.send_document', autospec=True, return_value=(403, None)) def test_parse_matrix_document__signups_closed(self, mock_send): result = parse_matrix_document(json.loads(MATRIX_SYNAPSE_DOC), 'feneas.org')