Make an attempt at setting a proper mime-type when showing a file.
Prevents things like having the browser show raw binary data when you have a PDF in your repo.
This commit is contained in:
@@ -141,6 +141,7 @@ module Precious
|
|||||||
@content = page.formatted_data
|
@content = page.formatted_data
|
||||||
mustache :page
|
mustache :page
|
||||||
elsif file = wiki.file(name)
|
elsif file = wiki.file(name)
|
||||||
|
content_type MIME::Types.type_for(name).to_s
|
||||||
file.raw_data
|
file.raw_data
|
||||||
else
|
else
|
||||||
@name = name
|
@name = name
|
||||||
|
|||||||
Reference in New Issue
Block a user