about summary refs log tree commit diff
path: root/app/controllers/xrd_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/xrd_controller.rb')
-rw-r--r--app/controllers/xrd_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/xrd_controller.rb b/app/controllers/xrd_controller.rb
index 159a954b3..003ffc182 100644
--- a/app/controllers/xrd_controller.rb
+++ b/app/controllers/xrd_controller.rb
@@ -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