# 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
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)