From 1d013693fae43e29b01629efd4783a9c17839e53 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:12:58 +1300 Subject: [PATCH] lemmy compatibility --- app/activitypub/routes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index ec87a455..698903f9 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -157,7 +157,7 @@ def community_profile(actor): else: community: Community = Community.query.filter_by(name=actor, banned=False, ap_id=None).first() if community is not None: - if 'application/ld+json' in request.headers.get('Accept', ''): + if 'application/ld+json' in request.headers.get('Accept', '') or 'application/activity+json' in request.headers.get('Accept', ''): server = current_app.config['SERVER_NAME'] actor_data = {"@context": default_context(), "type": "Group", @@ -177,13 +177,13 @@ def community_profile(actor): "publicKey": { "id": f"https://{server}/c/{actor}#main-key", "owner": f"https://{server}/c/{actor}", - "publicKeyPem": community.public_key.replace("\n", "\\n") + "publicKeyPem": community.public_key }, "endpoints": { "sharedInbox": f"https://{server}/inbox" }, - "published": community.created_at.isoformat(), - "updated": community.last_active.isoformat(), + "published": community.created_at.isoformat() + '+00:00', + "updated": community.last_active.isoformat() + '+00:00', } if community.icon_id is not None: actor_data["icon"] = {