Commit b664b784f16f5f0fca295af538483bb83c20f98f
1 parent
5b66e08a
Exists in
master
and in
4 other branches
linguist and web browser will take care of mimetype and encoding problem.
Showing
1 changed file
with
1 additions
and
8 deletions
Show diff stats
app/controllers/blob_controller.rb
| ... | ... | @@ -11,16 +11,9 @@ class BlobController < ProjectResourceController |
| 11 | 11 | |
| 12 | 12 | def show |
| 13 | 13 | if @tree.is_blob? |
| 14 | - if @tree.text? | |
| 15 | - encoding = detect_encoding(@tree.data) | |
| 16 | - mime_type = encoding ? "text/plain; charset=#{encoding}" : "text/plain" | |
| 17 | - else | |
| 18 | - mime_type = @tree.mime_type | |
| 19 | - end | |
| 20 | - | |
| 21 | 14 | send_data( |
| 22 | 15 | @tree.data, |
| 23 | - type: mime_type, | |
| 16 | + type: @tree.mime_type, | |
| 24 | 17 | disposition: 'inline', |
| 25 | 18 | filename: @tree.name |
| 26 | 19 | ) | ... | ... |