diff --git a/app/controllers/node_info_controller.rb b/app/controllers/node_info_controller.rb index cb831a595..18aa93c98 100644 --- a/app/controllers/node_info_controller.rb +++ b/app/controllers/node_info_controller.rb @@ -20,4 +20,14 @@ class NodeInfoController < ApplicationController format.all { @statistics = NodeInfoPresenter.new("1.0") } end end + + # TODO: this is only a dummy endpoint, because old versions of the ConnectionTester (<= 0.7.17.0) + # checked for this endpoint. Remove this endpoint again once most pods are updated to >= 0.7.18.0 + def host_meta + render xml: <<~XML + + + + XML + end end diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb index 11a6a225b..4575c3b64 100644 --- a/config/initializers/cors.rb +++ b/config/initializers/cors.rb @@ -11,7 +11,6 @@ Rails.application.config.middleware.insert_before 0, Rack::Cors do allow do origins "*" resource "/api/*", methods: :any - resource "/.well-known/host-meta" resource "/.well-known/webfinger" resource "/.well-known/openid-configuration" end diff --git a/config/routes.rb b/config/routes.rb index f15cdd1d1..45f992209 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -213,6 +213,7 @@ Rails.application.routes.draw do get ".well-known/nodeinfo", to: "node_info#jrd" get "nodeinfo/:version", to: "node_info#document", as: "node_info", constraints: {version: /\d+\.\d+/} get "statistics", to: "node_info#statistics" + get ".well-known/host-meta", to: "node_info#host_meta" # Terms if AppConfig.settings.terms.enable? || Rails.env.test?