mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 00:22:22 -04:00
Do not raise a 500 exception when previewing empty media. (#8883)
This commit is contained in:
parent
92d87c6882
commit
1f3748f033
3 changed files with 22 additions and 12 deletions
|
@ -676,7 +676,11 @@ class PreviewUrlResource(DirectServeJsonResource):
|
|||
logger.debug("No media removed from url cache")
|
||||
|
||||
|
||||
def decode_and_calc_og(body, media_uri, request_encoding=None):
|
||||
def decode_and_calc_og(body, media_uri, request_encoding=None) -> Dict[str, str]:
|
||||
# If there's no body, nothing useful is going to be found.
|
||||
if not body:
|
||||
return {}
|
||||
|
||||
from lxml import etree
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue