kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
1b96e953d5
commit
938a4ac85c
|
@ -0,0 +1,17 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ domain }}'s followers - Bridgy Fed{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2 class="row">
|
||||
<a href="https://{{ domain }}/">🌐 {{ domain }}</a>
|
||||
</h2>
|
||||
<h3 class="row">
|
||||
<a href="/user/{{ domain }}/followers">{{ followers }} follower{% if followers != '1' %}s{% endif %}</a>
|
||||
<!-- | <a href="/user/{{ domain }}/following">{{ following }} following</a> -->
|
||||
</h3>
|
||||
|
||||
{% include "responses.html" %}
|
||||
|
||||
{% endblock %}
|
|
@ -366,6 +366,18 @@ class WebmentionTest(testutil.TestCase):
|
|||
|
||||
mock_get.assert_has_calls((self.req('http://a/post'),))
|
||||
|
||||
def test_backlink_without_trailing_slash(self, mock_get, mock_post):
|
||||
mock_get.return_value = requests_response(
|
||||
self.reply_html.replace('<a href="http://localhost/"></a>',
|
||||
'<a href="http://localhost"></a>'),
|
||||
content_type=CONTENT_TYPE_HTML)
|
||||
|
||||
got = self.client.post('/webmention', data={
|
||||
'source': 'http://a/post',
|
||||
'target': 'https://fed.brid.gy/',
|
||||
})
|
||||
self.assertEqual(200, got.status_code)
|
||||
|
||||
def test_activitypub_create_reply(self, mock_get, mock_post):
|
||||
mock_get.side_effect = self.activitypub_gets
|
||||
mock_post.return_value = requests_response('abc xyz', status=203)
|
||||
|
|
|
@ -54,9 +54,10 @@ class Webmention(View):
|
|||
|
||||
# check for backlink to bridgy fed (for webmention spec and to confirm
|
||||
# source's intent to federate to mastodon)
|
||||
if (request.host_url not in source_resp.text and
|
||||
urllib.parse.quote(request.host_url, safe='') not in source_resp.text):
|
||||
error("Couldn't find link to {request.host_url}")
|
||||
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}")
|
||||
|
||||
# convert source page to ActivityStreams
|
||||
entry = mf2util.find_first_entry(self.source_mf2, ['h-entry'])
|
||||
|
|
Ładowanie…
Reference in New Issue