Commit 26ebfa20f082214f3dbd5d5ca49957d8cc83d234

Authored by Dmitriy Zaporozhets
2 parents 87a449f2 3c742dad

Merge branch 'bug/blob_escaped_json' into 'master'

Fixed bug with json files content being escaped in api

Fixes #1035
Showing 2 changed files with 3 additions and 3 deletions   Show diff stats
lib/api/api.rb
@@ -22,6 +22,8 @@ module API @@ -22,6 +22,8 @@ module API
22 end 22 end
23 23
24 format :json 24 format :json
  25 + content_type :txt, "text/plain"
  26 +
25 helpers APIHelpers 27 helpers APIHelpers
26 28
27 mount Groups 29 mount Groups
lib/api/repositories.rb
@@ -167,9 +167,7 @@ module API @@ -167,9 +167,7 @@ module API
167 blob = Gitlab::Git::Blob.find(repo, commit.id, params[:filepath]) 167 blob = Gitlab::Git::Blob.find(repo, commit.id, params[:filepath])
168 not_found! "File" unless blob 168 not_found! "File" unless blob
169 169
170 - env['api.format'] = :txt  
171 -  
172 - content_type blob.mime_type 170 + content_type 'text/plain'
173 present blob.data 171 present blob.data
174 end 172 end
175 173