From ba65db7e62264b94a7303681e30db4ac415b4822 Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 12 Jun 2018 16:23:10 +0200 Subject: fixed api content types --- application.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'application.rb') diff --git a/application.rb b/application.rb index 8d0429f..96e564b 100644 --- a/application.rb +++ b/application.rb @@ -14,7 +14,24 @@ configure :development do end before do - @version = File.read("VERSION").chomp + paths = [ + "/aa", + "/api", + "/compound", + "/dataset", + "/feature", + "/model", + "/nanoparticle", + "/report", + "/substance", + "/swagger", + "/validation"] + if paths.include?(request.path) + @accept = request.env['HTTP_ACCEPT'] + response['Content-Type'] = @accept + else + @version = File.read("VERSION").chomp + end end not_found do -- cgit v1.2.3