diff options
author | David Yip <yipdw@member.fsf.org> | 2017-12-30 18:24:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-30 18:24:38 -0600 |
commit | d817c0a958efda990af654f72d15d6f42b43dd49 (patch) | |
tree | 0cff3632163fadeba3585f56ecdd8d1d919e12c7 /app/controllers/well_known | |
parent | 65c87ca0ae20eb5dc62751047bda3e8b11e37ce0 (diff) | |
parent | 4cca1d1e7efce51eecb64489f412a7b8631f0aed (diff) |
Merge pull request #291 from glitch-soc/merge-upstream
Merge with upstream @ f4b80e6511f21b60f71ed182bb66ca6ef0ba9f66
Diffstat (limited to 'app/controllers/well_known')
-rw-r--r-- | app/controllers/well_known/host_meta_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/well_known/webfinger_controller.rb | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/well_known/host_meta_controller.rb b/app/controllers/well_known/host_meta_controller.rb index 40f96eaa2..5fb70288a 100644 --- a/app/controllers/well_known/host_meta_controller.rb +++ b/app/controllers/well_known/host_meta_controller.rb @@ -1,15 +1,19 @@ # frozen_string_literal: true module WellKnown - class HostMetaController < ApplicationController + class HostMetaController < ActionController::Base include RoutingHelper + before_action { response.headers['Vary'] = 'Accept' } + def show @webfinger_template = "#{webfinger_url}?resource={uri}" respond_to do |format| format.xml { render content_type: 'application/xrd+xml' } end + + expires_in(3.days, public: true) end end end diff --git a/app/controllers/well_known/webfinger_controller.rb b/app/controllers/well_known/webfinger_controller.rb index 5cc606808..28654b61d 100644 --- a/app/controllers/well_known/webfinger_controller.rb +++ b/app/controllers/well_known/webfinger_controller.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module WellKnown - class WebfingerController < ApplicationController + class WebfingerController < ActionController::Base include RoutingHelper + before_action { response.headers['Vary'] = 'Accept' } + def show @account = Account.find_local!(username_from_resource) @@ -16,6 +18,8 @@ module WellKnown render content_type: 'application/xrd+xml' end end + + expires_in(3.days, public: true) rescue ActiveRecord::RecordNotFound head 404 end |