Skip to content
Snippets Groups Projects
Commit b664b784 authored by Saito's avatar Saito
Browse files

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

parent 5b66e08a
Branches
Tags
No related merge requests found
Loading
@@ -11,16 +11,9 @@ class BlobController < ProjectResourceController
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment