diff --git a/tests/users/views/test_activitypub.py b/tests/users/views/test_activitypub.py index c15e232..9bde51f 100644 --- a/tests/users/views/test_activitypub.py +++ b/tests/users/views/test_activitypub.py @@ -8,7 +8,9 @@ def test_webfinger_actor(client, identity): """ identity.generate_keypair() # Fetch their webfinger - data = client.get("/.well-known/webfinger?resource=acct:test@example.com").json() + response = client.get("/.well-known/webfinger?resource=acct:test@example.com") + assert response.headers["content-type"] == "application/jrd+json" + data = response.json() assert data["subject"] == "acct:test@example.com" assert data["aliases"][0] == "https://example.com/@test/" # Fetch their actor diff --git a/users/views/activitypub.py b/users/views/activitypub.py index 985a00e..774901b 100644 --- a/users/views/activitypub.py +++ b/users/views/activitypub.py @@ -41,7 +41,7 @@ class HostMeta(View): """ % request.headers["host"], - content_type="application/xml", + content_type="application/xrd+xml", ) @@ -110,7 +110,7 @@ class Webfinger(View): else: actor = by_handle_or_404(request, handle) - return JsonResponse(actor.to_webfinger()) + return JsonResponse(actor.to_webfinger(), content_type="application/jrd+json") @method_decorator(csrf_exempt, name="dispatch")