about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-18 03:34:26 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-18 03:34:26 +0200
commit2e0a38d07c4611b1f2817cd70f6e95ca6b772ec2 (patch)
tree9f51518fe331a75ea5397c66ac9044b8214478a5 /app/controllers
parentd5e086a47bedc93a1ab2d197e0400ef5bc2d0e3d (diff)
Added e-mail edit field to settings, proper format default for webfinger
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/xrd_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/xrd_controller.rb b/app/controllers/xrd_controller.rb
index e00485f5e..159a954b3 100644
--- a/app/controllers/xrd_controller.rb
+++ b/app/controllers/xrd_controller.rb
@@ -1,4 +1,6 @@
 class XrdController < ApplicationController
+  before_action :set_default_format
+
   def host_meta
     @webfinger_template = "#{webfinger_url}?resource={uri}"
 
@@ -22,6 +24,10 @@ class XrdController < ApplicationController
 
   private
 
+  def set_default_format
+    request.format = 'json' if request.headers["HTTP_ACCEPT"].nil? && params[:format].nil?
+  end
+
   def username_from_resource
     if resource_param.start_with?('acct:') || resource_param.include?('@')
       resource_param.split('@').first.gsub('acct:', '')