fixes raw view for text files with code like *.rb
This commit is contained in:
parent
ec1a426726
commit
4647c6fa3a
|
@ -37,7 +37,12 @@ class RefsController < ApplicationController
|
||||||
|
|
||||||
def blob
|
def blob
|
||||||
if @tree.is_blob?
|
if @tree.is_blob?
|
||||||
send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name)
|
send_data(
|
||||||
|
@tree.data,
|
||||||
|
:type => @tree.text? ? "text/plain" : @tree.mime_type,
|
||||||
|
:disposition => 'inline',
|
||||||
|
:filename => @tree.name
|
||||||
|
)
|
||||||
else
|
else
|
||||||
head(404)
|
head(404)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue