Class: DiasporaFederation::FetchController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- DiasporaFederation::FetchController
- Defined in:
- app/controllers/diaspora_federation/fetch_controller.rb
Overview
This controller processes fetch requests.
Instance Method Summary collapse
-
#fetch ⇒ Object
Returns the fetched entity or a redirect.
Methods inherited from ApplicationController
Instance Method Details
#fetch ⇒ Object
Returns the fetched entity or a redirect
GET /fetch/:type/:guid
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/diaspora_federation/fetch_controller.rb', line 11 def fetch entity = fetch_public_entity if entity magic_env = create_magic_envelope(entity) if magic_env render xml: magic_env, content_type: "application/magic-envelope+xml" else redirect_url = DiasporaFederation.callbacks.trigger(:fetch_person_url_to, entity., "/fetch/#{params[:type]}/#{params[:guid]}") redirect_to redirect_url, allow_other_host: true end else head :not_found end end |