Commit b664b784 authored by Saito's avatar Saito

linguist and web browser will take care of mimetype and encoding problem.

parent 5b66e08a
...@@ -11,16 +11,9 @@ class BlobController < ProjectResourceController ...@@ -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
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment