diff options
Diffstat (limited to 'synapse/rest/media/v1/preview_html.py')
-rw-r--r-- | synapse/rest/media/v1/preview_html.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/preview_html.py b/synapse/rest/media/v1/preview_html.py index c9711956f1..4dc9be5124 100644 --- a/synapse/rest/media/v1/preview_html.py +++ b/synapse/rest/media/v1/preview_html.py @@ -14,7 +14,7 @@ import itertools import logging import re -from typing import TYPE_CHECKING, Dict, Generator, Iterable, Iterator, Optional +from typing import TYPE_CHECKING, Dict, Generator, Iterable, Iterator, Optional, Union if TYPE_CHECKING: from bs4 import BeautifulSoup @@ -25,7 +25,7 @@ logger = logging.getLogger(__name__) _content_type_match = re.compile(r'.*; *charset="?(.*?)"?(;|$)', flags=re.I) -def decode_body(body: bytes, uri: str) -> Optional["BeautifulSoup"]: +def decode_body(body: Union[bytes, str], uri: str) -> Optional["BeautifulSoup"]: """ This uses BeautifulSoup to parse the HTML document. |