mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 07:52:56 +01:00
Apply suggestions from code review
Co-Authored-By: Brendan Abolivier <babolivier@matrix.org> Co-Authored-By: Erik Johnston <erik@matrix.org>
This commit is contained in:
parent
e9bfe719ba
commit
e78167c94b
2 changed files with 2 additions and 1 deletions
|
@ -518,7 +518,7 @@ def _calc_og(tree, media_uri):
|
|||
if "content" in tag.attrib:
|
||||
# if we've got more than 50 tags, someone is taking the piss
|
||||
if len(og) >= 50:
|
||||
logger.warning("skipping OG for page with too many og: tags")
|
||||
logger.warning("Skipping OG for page with too many 'og:' tags")
|
||||
return {}
|
||||
og[tag.attrib["property"]] = tag.attrib["content"]
|
||||
|
||||
|
|
|
@ -279,6 +279,7 @@ class URLPreviewTests(unittest.HomeserverTestCase):
|
|||
self.pump()
|
||||
self.assertEqual(channel.code, 200)
|
||||
res = channel.json_body
|
||||
# We should only see the `og:description` field, as `title` is too long and should be stripped out
|
||||
self.assertCountEqual(["og:description"], res.keys())
|
||||
|
||||
def test_ipaddr(self):
|
||||
|
|
Loading…
Reference in a new issue