kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
320b117470
commit
2d9cc31ff9
|
@ -87,7 +87,7 @@ def actor(domain):
|
|||
if tld in common.TLD_BLOCKLIST:
|
||||
error('', status=404)
|
||||
|
||||
mf2 = util.fetch_mf2(f'http://{domain}/', gateway=True)
|
||||
mf2 = util.fetch_mf2(f'https://{domain}/', gateway=True)
|
||||
|
||||
hcard = mf2util.representative_hcard(mf2, mf2['url'])
|
||||
logger.info(f'Representative h-card: {json_dumps(hcard, indent=2)}')
|
||||
|
|
|
@ -158,7 +158,7 @@ class ActivityPubTest(testutil.TestCase):
|
|||
""", url='https://foo.com/', content_type=common.CONTENT_TYPE_HTML)
|
||||
|
||||
got = self.client.get('/foo.com')
|
||||
self.assert_req(mock_get, 'http://foo.com/')
|
||||
self.assert_req(mock_get, 'https://foo.com/')
|
||||
self.assertEqual(200, got.status_code)
|
||||
type = got.headers['Content-Type']
|
||||
self.assertTrue(type.startswith(common.CONTENT_TYPE_AS2), type)
|
||||
|
@ -195,7 +195,7 @@ class ActivityPubTest(testutil.TestCase):
|
|||
""")
|
||||
|
||||
got = self.client.get('/foo.com')
|
||||
self.assert_req(mock_get, 'http://foo.com/')
|
||||
self.assert_req(mock_get, 'https://foo.com/')
|
||||
self.assertEqual(400, got.status_code)
|
||||
self.assertIn('representative h-card', got.get_data(as_text=True))
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ class WebfingerTest(testutil.TestCase):
|
|||
got = self.client.get('/acct:foo.com', headers={'Accept': 'application/json'})
|
||||
self.assertEqual(200, got.status_code)
|
||||
self.assertEqual('application/jrd+json', got.headers['Content-Type'])
|
||||
self.assert_req(mock_get, 'http://foo.com/')
|
||||
self.assert_req(mock_get, 'https://foo.com/')
|
||||
|
||||
self.assertEqual(self.expected_webfinger, got.json)
|
||||
|
||||
|
@ -170,7 +170,7 @@ class WebfingerTest(testutil.TestCase):
|
|||
</body>
|
||||
""")
|
||||
got = self.client.get('/acct:foo.com')
|
||||
self.assert_req(mock_get, 'http://foo.com/')
|
||||
self.assert_req(mock_get, 'https://foo.com/')
|
||||
self.assertEqual(400, got.status_code)
|
||||
self.assertIn('representative h-card', got.get_data(as_text=True))
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class Actor(flask_util.XrdOrJrd):
|
|||
error(f"{domain} doesn't look like a domain", status=404)
|
||||
|
||||
# find representative h-card. try url, then url's home page, then domain
|
||||
urls = [f'http://{domain}/']
|
||||
urls = [f'https://{domain}/']
|
||||
if url:
|
||||
urls = [url, urllib.parse.urljoin(url, '/')] + urls
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue