linguist and web browser will take care of mimetype and encoding problem.
This commit is contained in:
parent
5b66e08ae5
commit
b664b784f1
1 changed files with 1 additions and 8 deletions
|
@ -11,16 +11,9 @@ class BlobController < ProjectResourceController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
if @tree.is_blob?
|
if @tree.is_blob?
|
||||||
if @tree.text?
|
|
||||||
encoding = detect_encoding(@tree.data)
|
|
||||||
mime_type = encoding ? "text/plain; charset=#{encoding}" : "text/plain"
|
|
||||||
else
|
|
||||||
mime_type = @tree.mime_type
|
|
||||||
end
|
|
||||||
|
|
||||||
send_data(
|
send_data(
|
||||||
@tree.data,
|
@tree.data,
|
||||||
type: mime_type,
|
type: @tree.mime_type,
|
||||||
disposition: 'inline',
|
disposition: 'inline',
|
||||||
filename: @tree.name
|
filename: @tree.name
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue