diff --git a/app/serializers/node_info/discovery_serializer.rb b/app/serializers/node_info/discovery_serializer.rb index 07ab2a6eee3..bb9e7385229 100644 --- a/app/serializers/node_info/discovery_serializer.rb +++ b/app/serializers/node_info/discovery_serializer.rb @@ -6,6 +6,9 @@ class NodeInfo::DiscoverySerializer < ActiveModel::Serializer attribute :links def links - [{ rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: nodeinfo_schema_url }] + [ + { rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: nodeinfo_schema_url }, + { rel: 'https://www.w3.org/ns/activitystreams#Application', href: instance_actor_url }, + ] end end diff --git a/spec/requests/well_known/node_info_spec.rb b/spec/requests/well_known/node_info_spec.rb index 0934b0fde6f..c62d7ac4677 100644 --- a/spec/requests/well_known/node_info_spec.rb +++ b/spec/requests/well_known/node_info_spec.rb @@ -19,6 +19,10 @@ describe 'The well-known node-info endpoints' do include( rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: include('nodeinfo/2.0') + ), + include( + rel: 'https://www.w3.org/ns/activitystreams#Application', + href: end_with('/actor') ) ) ) diff --git a/spec/routing/well_known_routes_spec.rb b/spec/routing/well_known_routes_spec.rb index 8cf08c13c12..63d0867bc9d 100644 --- a/spec/routing/well_known_routes_spec.rb +++ b/spec/routing/well_known_routes_spec.rb @@ -16,4 +16,16 @@ describe 'Well Known routes' do .to route_to('well_known/webfinger#show') end end + + describe 'the nodeinfo routes' do + it 'routes to discovery (index) route' do + expect(get('/.well-known/nodeinfo')) + .to route_to('well_known/node_info#index', format: 'json') + end + + it 'routes to the show route' do + expect(get('/nodeinfo/2.0')) + .to route_to('well_known/node_info#show') + end + end end