From 2e0ec5b0e66d288a476d79b2163a316dbbed0f8c Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 6 Jun 2019 14:47:34 +0000 Subject: Remove trailing whitespaces from app (#31506). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18230 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/attachments_controller.rb | 2 +- app/controllers/previews_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c5f615d20..5d705844b 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -239,7 +239,7 @@ class AttachmentsController < ApplicationController def detect_content_type(attachment, is_thumb = false) content_type = attachment.content_type if content_type.blank? || content_type == "application/octet-stream" - content_type = + content_type = Redmine::MimeType.of(attachment.filename).presence || "application/octet-stream" end diff --git a/app/controllers/previews_controller.rb b/app/controllers/previews_controller.rb index 716d27cae..e431ab0de 100644 --- a/app/controllers/previews_controller.rb +++ b/app/controllers/previews_controller.rb @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class PreviewsController < ApplicationController - before_action :find_project, :except => :text + before_action :find_project, :except => :text before_action :find_attachments def issue -- cgit v1.2.3