X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9018d1af07c53b03bf8caf0480b931dc25f57147..6312e37f6b457ee256cea19170719f1e4058c482:/app/controllers/api_controller.rb?ds=inline diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index a13897640..050c455cd 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -31,9 +31,8 @@ class ApiController < ApplicationController # as XML for backwards compatibility - all other formats are discarded # which will result in a 406 Not Acceptable response being sent formats = mimetypes.map do |mime| - if mime.symbol == :xml then :xml + if mime.symbol == :xml || mime == "*/*" then :xml elsif mime.symbol == :json then :json - elsif mime == "*/*" then :xml end end else @@ -101,7 +100,7 @@ class ApiController < ApplicationController elsif Authenticator.new(self, [:token]).allow? # self.current_user setup by OAuth else - username, passwd = get_auth_data # parse from headers + username, passwd = auth_data # parse from headers # authenticate per-scheme self.current_user = if username.nil? nil # no authentication provided - perhaps first connect (client should retry after 401)