From: mmd-osm Date: Thu, 2 Jan 2020 14:17:11 +0000 (+0100) Subject: JSON output, handle Accept header X-Git-Tag: live~2823^2~6 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/97036c181e307dae10bb019dbcbd7a50d30bb3b8 JSON output, handle Accept header --- diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index ca09e5807..7599568af 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -5,7 +5,9 @@ class ApiController < ApplicationController # Set format to xml unless client requires a specific format def default_format_xml - request.format = "xml" unless params[:format] + unless params[:format] + request.format = "xml" unless request.format.symbol == :json + end end def authorize(realm = "Web Password", errormessage = "Couldn't authenticate you")