X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dbe165bbb3d6eda37d9579f1ac767599f9055607..1e30edba53f179fb06a1233b245252d1d5a8ead1:/app/controllers/search_controller.rb diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 6e9130a52..3a2e4040f 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -3,7 +3,7 @@ class SearchController < ApplicationController # Can search by tag k, v, or both (type->k,value->v) # Can search by name (k=name,v=....) skip_before_action :verify_authenticity_token - after_action :compress_output + authorize_resource :class => false def search_all do_search(true, true, true) @@ -34,13 +34,13 @@ class SearchController < ApplicationController if do_nodes response.headers["Error"] = "Searching of nodes is currently unavailable" - render :text => "", :status => :service_unavailable + head :service_unavailable return false end unless value response.headers["Error"] = "Searching for a key without value is currently unavailable" - render :text => "", :status => :service_unavailable + head :service_unavailable return false end @@ -92,9 +92,9 @@ class SearchController < ApplicationController end relations.each do |rel| - doc.root << rel.to_xml_node(nil, changeset_cache, user_display_name_cache) + doc.root << rel.to_xml_node(changeset_cache, user_display_name_cache) end - render :text => doc.to_s, :content_type => "text/xml" + render :xml => doc.to_s end end