From b7e98620046501144302ff8f9fbf22ff03ef4db7 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Thu, 10 Aug 2017 16:16:54 -0300 Subject: Fix API responses when dealing with txt files --- lib/api/files.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/api') diff --git a/lib/api/files.rb b/lib/api/files.rb index 450334fee84..e2ac7142bc4 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -1,5 +1,8 @@ module API class Files < Grape::API + # Prevents returning plain/text responses for files with .txt extension + after_validation { content_type "application/json" } + helpers do def commit_params(attrs) { -- cgit v1.2.1