]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Use casecmp?() instead of casecmp().zero?
[rails.git] / app / controllers / application_controller.rb
index 05fa76658d55bedeecf412c4a5d1927cb6ce3899..c6223fb9d6228890ea86c6bc6420a14d58f2f9fe 100644 (file)
@@ -181,7 +181,7 @@ class ApplicationController < ActionController::Base
     # TODO: some sort of escaping of problem characters in the message
     response.headers["Error"] = message
 
-    if request.headers["X-Error-Format"]&.casecmp("xml")&.zero?
+    if request.headers["X-Error-Format"]&.casecmp?("xml")
       result = OSM::API.new.xml_doc
       result.root.name = "osmError"
       result.root << (XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")