Commit 4647c6fa3a9fbf58a4a2f60d31fc9a1a0633c3df
1 parent
ec1a4267
Exists in
master
and in
4 other branches
fixes raw view for text files with code like *.rb
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
app/controllers/refs_controller.rb
| ... | ... | @@ -37,7 +37,12 @@ class RefsController < ApplicationController |
| 37 | 37 | |
| 38 | 38 | def blob |
| 39 | 39 | if @tree.is_blob? |
| 40 | - send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) | |
| 40 | + send_data( | |
| 41 | + @tree.data, | |
| 42 | + :type => @tree.text? ? "text/plain" : @tree.mime_type, | |
| 43 | + :disposition => 'inline', | |
| 44 | + :filename => @tree.name | |
| 45 | + ) | |
| 41 | 46 | else |
| 42 | 47 | head(404) |
| 43 | 48 | end | ... | ... |