From 97036c181e307dae10bb019dbcbd7a50d30bb3b8 Mon Sep 17 00:00:00 2001 From: mmd-osm Date: Thu, 2 Jan 2020 15:17:11 +0100 Subject: [PATCH] JSON output, handle Accept header --- app/controllers/api_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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") -- 2.43.2