diff --git a/apps/dashboard/app/models/files.rb b/apps/dashboard/app/models/files.rb index 8234f9a12c..f513bc50c0 100644 --- a/apps/dashboard/app/models/files.rb +++ b/apps/dashboard/app/models/files.rb @@ -132,11 +132,10 @@ def self.mime_type_for_preview(type) # x === 'application/x-yaml' # # => true # - case type - when 'text/javascript', 'text/css', 'text/yaml', 'text/yml' - 'text/plain' - else + if %r{text/.*}.match(type).nil? type + else + 'text/plain; charset=utf-8' end end