Commit b664b784f16f5f0fca295af538483bb83c20f98f

Authored by Saito
1 parent 5b66e08a

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

Showing 1 changed file with 1 additions and 8 deletions   Show diff stats
app/controllers/blob_controller.rb
@@ -11,16 +11,9 @@ class BlobController < ProjectResourceController @@ -11,16 +11,9 @@ class BlobController < ProjectResourceController
11 11
12 def show 12 def show
13 if @tree.is_blob? 13 if @tree.is_blob?
14 - if @tree.text?  
15 - encoding = detect_encoding(@tree.data)  
16 - mime_type = encoding ? "text/plain; charset=#{encoding}" : "text/plain"  
17 - else  
18 - mime_type = @tree.mime_type  
19 - end  
20 -  
21 send_data( 14 send_data(
22 @tree.data, 15 @tree.data,
23 - type: mime_type, 16 + type: @tree.mime_type,
24 disposition: 'inline', 17 disposition: 'inline',
25 filename: @tree.name 18 filename: @tree.name
26 ) 19 )