/webmention: allow any backlink, not just request.host_url

first step toward making local flask server fully capable of acting like fed.brid.gy
pull/319/head
Ryan Barrett 2022-11-24 09:38:30 -08:00
rodzic 2fdc6f29a9
commit 7f5f4e4542
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -62,10 +62,11 @@ class Webmention(View):
# check for backlink to bridgy fed (for webmention spec and to confirm
# source's intent to federate to mastodon)
host_url = request.host_url.rstrip('/') # don't require / path
if (host_url not in source_resp.text and
urllib.parse.quote(host_url, safe='') not in source_resp.text):
error(f"Couldn't find link to {host_url}")
for domain in common.DOMAINS:
if domain in source_resp.text:
break
else:
error(f"Couldn't find link to {request.host_url.rstrip('/')}")
# convert source page to ActivityStreams
entry = mf2util.find_first_entry(self.source_mf2, ['h-entry'])