X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d951621c4488c58ec6caf12daf81a2b048fd40b1..159ef16601b7b7157ce9d766db97c4189d145e42:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d0898bf5e..1d6865405 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -161,7 +161,7 @@ class ApplicationController < ActionController::Base response.headers["Error"] = message if request.headers["X-Error-Format"]&.casecmp("xml")&.zero? - result = OSM::API.new.get_xml_doc + 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]}") result.root << (XML::Node.new("message") << message) @@ -349,7 +349,7 @@ class ApplicationController < ActionController::Base elsif current_user set_locale respond_to do |format| - format.html { redirect_to :controller => "errors", :action => "forbidden" } + format.html { redirect_to :controller => "/errors", :action => "forbidden" } format.any { report_error t("application.permission_denied"), :forbidden } end elsif request.get? @@ -363,7 +363,7 @@ class ApplicationController < ActionController::Base end # extract authorisation credentials from headers, returns user = nil if none - def get_auth_data + def auth_data if request.env.key? "X-HTTP_AUTHORIZATION" # where mod_rewrite might have put it authdata = request.env["X-HTTP_AUTHORIZATION"].to_s.split elsif request.env.key? "REDIRECT_X_HTTP_AUTHORIZATION" # mod_fcgi @@ -397,7 +397,7 @@ class ApplicationController < ActionController::Base referer = nil end - referer.to_s + referer&.to_s end def scope_enabled?(scope)