Commit 3c742dad27d298fae9aa8ee68cf1a83178fb8704
1 parent
87a449f2
Exists in
spb-stable
and in
3 other branches
Fixed bug with json files content being escaped in api
After update to recent grape env['api.format'] does not work any more. Use content_type for rendering raw json files content Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
lib/api/api.rb
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 |