X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e222329d043592af299eed12cf6ad16969c1b46f..694d45cd31c65e06a342ae3d038af563c5dc7731:/app/controllers/api_controller.rb 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)