debian-mirror-gitlab/app/uploaders/favicon_uploader.rb

21 lines
428 B
Ruby
Raw Normal View History

2018-11-08 19:23:39 +05:30
# frozen_string_literal: true
class FaviconUploader < AttachmentUploader
EXTENSION_WHITELIST = %w[png ico].freeze
2020-04-08 14:13:33 +05:30
MIME_WHITELIST = %w[image/png image/vnd.microsoft.icon].freeze
2020-03-09 13:42:32 +05:30
2018-11-08 19:23:39 +05:30
def extension_whitelist
EXTENSION_WHITELIST
end
2020-04-08 14:13:33 +05:30
def content_type_whitelist
MIME_WHITELIST
end
2018-11-08 19:23:39 +05:30
private
def filename_for_different_format(filename, format)
filename.chomp(File.extname(filename)) + ".#{format}"
end
end