diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-16 21:08:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-16 21:08:22 +0300 |
commit | 123c68a7cf788ace140e57e478a12c5b7ac893ae (patch) | |
tree | b36e565ecd895ee46c1713f3734308cfce0e6ba9 /lib/gitlab/file_type_detection.rb | |
parent | 862d225ca0d8eb452e56b8fe5a0109aac796e872 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/file_type_detection.rb')
-rw-r--r-- | lib/gitlab/file_type_detection.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |