From 123c68a7cf788ace140e57e478a12c5b7ac893ae Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 16 Dec 2019 18:08:22 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/gitlab/file_type_detection.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/gitlab/file_type_detection.rb') diff --git a/lib/gitlab/file_type_detection.rb b/lib/gitlab/file_type_detection.rb index ca78d49f99b..e052792675a 100644 --- a/lib/gitlab/file_type_detection.rb +++ b/lib/gitlab/file_type_detection.rb @@ -20,6 +20,7 @@ module Gitlab module FileTypeDetection SAFE_IMAGE_EXT = %w[png jpg jpeg gif bmp tiff ico].freeze + PDF_EXT = 'pdf' # We recommend using the .mp4 format over .mov. Videos in .mov format can # still be used but you really need to make sure they are served with the # proper MIME type video/mp4 and not video/quicktime or your videos won't play @@ -46,6 +47,10 @@ module Gitlab extension_match?(SAFE_AUDIO_EXT) end + def pdf? + extension_match?([PDF_EXT]) + end + def embeddable? image? || video? || audio? end -- cgit v1.2.3