]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api_controller.rb
Move default_format_xml to api_controller
[rails.git] / app / controllers / api_controller.rb
index 44efdc0711f2cb39d53e8b59d33d58e8583dca5b..ca09e580751b3752e1922ea65712a2b63efe9b57 100644 (file)
@@ -3,6 +3,11 @@ class ApiController < ApplicationController
 
   private
 
+  # Set format to xml unless client requires a specific format
+  def default_format_xml
+    request.format = "xml" unless params[:format]
+  end
+
   def authorize(realm = "Web Password", errormessage = "Couldn't authenticate you")
     # make the current_user object from any auth sources we have
     setup_user_auth