2017-04-29 16:23:45 -06:00
|
|
|
# frozen_string_literal: true
|
2017-04-13 05:09:07 -06:00
|
|
|
|
|
|
|
module WellKnown
|
2023-04-19 08:07:29 -06:00
|
|
|
class HostMetaController < ActionController::Base # rubocop:disable Rails/ApplicationController
|
2017-06-02 14:21:36 -06:00
|
|
|
include RoutingHelper
|
|
|
|
|
2017-04-13 05:09:07 -06:00
|
|
|
def show
|
|
|
|
@webfinger_template = "#{webfinger_url}?resource={uri}"
|
2019-07-08 04:03:45 -06:00
|
|
|
expires_in 3.days, public: true
|
2024-10-02 03:23:44 -06:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.any do
|
|
|
|
render content_type: 'application/xrd+xml', formats: [:xml]
|
|
|
|
end
|
|
|
|
|
|
|
|
format.json do
|
|
|
|
render json: {
|
|
|
|
links: [
|
|
|
|
{
|
|
|
|
rel: 'lrdd',
|
|
|
|
template: @webfinger_template,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2017-04-13 05:09:07 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|