]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
JSON: return HTTP 406 for unsupported formats
[rails.git] / app / controllers / application_controller.rb
index bee5e8169a4709d05f5d36ead2c6924a03f2db6a..f419460ee77bc97762ad6c9bc230d0718cb88c9b 100644 (file)
@@ -185,6 +185,8 @@ class ApplicationController < ActionController::Base
 
   def api_call_handle_error
     yield
+  rescue ActionController::UnknownFormat
+    head :not_acceptable
   rescue ActiveRecord::RecordNotFound => e
     head :not_found
   rescue LibXML::XML::Error, ArgumentError => e