about summary refs log tree commit diff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-05-27 13:20:15 +0200
committerThibaut Girka <thib@sitedethib.com>2018-05-27 13:20:15 +0200
commit659b8a12ece7110608ee84748e57647c08d1dbda (patch)
tree1d8350cdad20ad1eb8c67a4d17a18ff7183f22e5 /app/controllers/application_controller.rb
parentc2e528916cae422baee3d72a3b4409a23c476b3f (diff)
parent63c7b9157274f57c496399a1a5c728b32415034c (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
	config/locales/ca.yml
	config/locales/nl.yml
	config/locales/oc.yml
	config/locales/pt-BR.yml

Resolved conflicts by removing upstream-specific changes
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 27ebc3333..cc92894a5 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -21,6 +21,7 @@ class ApplicationController < ActionController::Base
   rescue_from ActionController::RoutingError, with: :not_found
   rescue_from ActiveRecord::RecordNotFound, with: :not_found
   rescue_from ActionController::InvalidAuthenticityToken, with: :unprocessable_entity
+  rescue_from ActionController::UnknownFormat, with: :not_acceptable
   rescue_from Mastodon::NotPermittedError, with: :forbidden
 
   before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
@@ -143,6 +144,10 @@ class ApplicationController < ActionController::Base
     respond_with_error(422)
   end
 
+  def not_acceptable
+    respond_with_error(406)
+  end
+
   def single_user_mode?
     @single_user_mode ||= Rails.configuration.x.single_user_mode && Account.exists?
   end