Improving all forms
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
class XrdController < ApplicationController
|
||||
before_action :set_default_format
|
||||
before_action :set_default_format_json, only: :webfinger
|
||||
before_action :set_default_format_xml, only: :host_meta
|
||||
|
||||
def host_meta
|
||||
@webfinger_template = "#{webfinger_url}?resource={uri}"
|
||||
@ -24,7 +25,11 @@ class XrdController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def set_default_format
|
||||
def set_default_format_xml
|
||||
request.format = 'xml' if request.headers["HTTP_ACCEPT"].nil? && params[:format].nil?
|
||||
end
|
||||
|
||||
def set_default_format_json
|
||||
request.format = 'json' if request.headers["HTTP_ACCEPT"].nil? && params[:format].nil?
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user