diff --git a/activitypub.py b/activitypub.py index 05017189..28acf734 100644 --- a/activitypub.py +++ b/activitypub.py @@ -550,7 +550,11 @@ def actor(protocol, domain): g.user = cls.get_or_create(id=domain, actor_as2=actor_as2) # TODO: unify with common.actor() - actor = postprocess_as2(g.user.actor_as2 or {'type': 'Person'}) + actor = g.user.actor_as2 or { + '@context': [as2.CONTEXT], + 'type': 'Person', + } + actor = postprocess_as2(actor) actor.update({ 'id': g.user.ap_actor(), # This has to be the domain for Mastodon etc interop! It seems like it diff --git a/tests/test_activitypub.py b/tests/test_activitypub.py index f5e2da61..1c9deb30 100644 --- a/tests/test_activitypub.py +++ b/tests/test_activitypub.py @@ -304,7 +304,10 @@ def test_actor_fake(self, *_): type = got.headers['Content-Type'] self.assertTrue(type.startswith(as2.CONTENT_TYPE), type) self.assertEqual({ - '@context': ['https://w3id.org/security/v1'], + '@context': [ + 'https://www.w3.org/ns/activitystreams', + 'https://w3id.org/security/v1', + ], 'type': 'Person', 'id': 'http://bf/fake.com/ap', 'preferredUsername': 'fake.com',