kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
05c8dc83c4
commit
d85ffaec04
|
@ -292,3 +292,20 @@ def follower_collection(domain, collection):
|
|||
}
|
||||
logger.info(f'Returning {json_dumps(collection, indent=2)}')
|
||||
return collection, {'Content-Type': as2.CONTENT_TYPE}
|
||||
|
||||
|
||||
@app.get(f'/<regex("{common.DOMAIN_RE}"):domain>/outbox')
|
||||
def outbox(domain):
|
||||
url = common.host_url(f"{domain}/outbox")
|
||||
return {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
'id': url,
|
||||
'summary': f"{domain}'s outbox",
|
||||
'type': 'OrderedCollection',
|
||||
'totalItems': 0,
|
||||
'first': {
|
||||
'type': 'CollectionPage',
|
||||
'partOf': url,
|
||||
'items': [],
|
||||
},
|
||||
}, {'Content-Type': as2.CONTENT_TYPE}
|
||||
|
|
|
@ -816,3 +816,20 @@ class ActivityPubTest(testutil.TestCase):
|
|||
'next': f'http://localhost/foo.com/following?before={after}',
|
||||
'items': [ACTOR],
|
||||
}, resp.json)
|
||||
|
||||
|
||||
def test_outbox_empty(self, _, mock_get, __):
|
||||
resp = self.client.get(f'/foo.com/outbox')
|
||||
self.assertEqual(200, resp.status_code)
|
||||
self.assertEqual({
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
'id': 'http://localhost/foo.com/outbox',
|
||||
'summary': "foo.com's outbox",
|
||||
'type': 'OrderedCollection',
|
||||
'totalItems': 0,
|
||||
'first': {
|
||||
'type': 'CollectionPage',
|
||||
'partOf': 'http://localhost/foo.com/outbox',
|
||||
'items': [],
|
||||
},
|
||||
}, resp.json)
|
||||
|
|
Ładowanie…
Reference in New Issue