kopia lustrzana https://github.com/snarfed/bridgy-fed
/webmention: allow any backlink, not just request.host_url
first step toward making local flask server fully capable of acting like fed.brid.gypull/319/head
rodzic
2fdc6f29a9
commit
7f5f4e4542
|
@ -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'])
|
||||
|
|
Ładowanie…
Reference in New Issue