mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-21 20:54:27 +00:00
Bugfixes
This commit is contained in:
parent
bd4d5a004a
commit
91b8bb26b7
2 changed files with 4 additions and 1 deletions
|
@ -26,7 +26,7 @@ async def new_ap_incoming_activity(
|
|||
raw_object: ap.RawObject,
|
||||
) -> models.IncomingActivity | None:
|
||||
ap_id: str
|
||||
if "id" not in raw_object:
|
||||
if "id" not in raw_object or ap.as_list(raw_object["type"])[0] in ap.ACTOR_TYPES:
|
||||
if "@context" not in raw_object:
|
||||
logger.warning(f"Dropping invalid object: {raw_object}")
|
||||
return None
|
||||
|
|
|
@ -81,6 +81,9 @@ async def external_urls(
|
|||
soup = BeautifulSoup(ro.content, "html5lib")
|
||||
for link in soup.find_all("a"):
|
||||
h = link.get("href")
|
||||
if not h:
|
||||
continue
|
||||
|
||||
ph = urlparse(h)
|
||||
mimetype, _ = mimetypes.guess_type(h)
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue