Commit d5872f44 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '197-nodeinfo-accept' into 'develop'

Resolve "Nodeinfo endpoint should be queryable with Accept: application/json"

Closes #197

See merge request funkwhale/funkwhale!197
parents ceccaa13 e852c840
......@@ -88,7 +88,7 @@ class InstanceActorViewSet(FederationMixin, viewsets.GenericViewSet):
class WellKnownViewSet(viewsets.GenericViewSet):
authentication_classes = []
permission_classes = []
renderer_classes = [renderers.WebfingerRenderer]
renderer_classes = [renderers.JSONRenderer, renderers.WebfingerRenderer]
@list_route(methods=['get'])
def nodeinfo(self, request, *args, **kwargs):
......
......@@ -62,7 +62,10 @@ def test_wellknown_webfinger_system(
actor = actors.SYSTEM_ACTORS[system_actor].get_actor_instance()
url = reverse('federation:well-known-webfinger')
response = api_client.get(
url, data={'resource': 'acct:{}'.format(actor.webfinger_subject)})
url,
data={'resource': 'acct:{}'.format(actor.webfinger_subject)},
HTTP_ACCEPT='application/jrd+json',
)
serializer = serializers.ActorWebfingerSerializer(actor)
assert response.status_code == 200
......@@ -83,7 +86,7 @@ def test_wellknown_nodeinfo(db, preferences, api_client, settings):
]
}
url = reverse('federation:well-known-nodeinfo')
response = api_client.get(url)
response = api_client.get(url, HTTP_ACCEPT='application/jrd+json')
assert response.status_code == 200
assert response['Content-Type'] == 'application/jrd+json'
assert response.data == expected
......
.well-known/nodeinfo endpoint can now answer to request with Accept: application/json (#197)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment