Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-08-10 22:16:54 +0300
committerFelipe Artur <felipefac@gmail.com>2017-08-15 17:32:48 +0300
commitb7e98620046501144302ff8f9fbf22ff03ef4db7 (patch)
tree2cf1711f0f6f2b9576f624885de28062b50228f6 /lib/api/files.rb
parentfe09c25d68a61c5874e9beb0f018c05a4d789d70 (diff)
Fix API responses when dealing with txt files
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r--lib/api/files.rb3
1 files changed, 3 insertions, 0 deletions
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)
{