2018-07-04 13:32:46 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-26 03:51:24 -04:00
|
|
|
class FaviconUploader < AttachmentUploader
|
2018-05-17 13:00:32 -04:00
|
|
|
EXTENSION_WHITELIST = %w[png ico].freeze
|
2020-03-12 14:09:28 -04:00
|
|
|
MIME_WHITELIST = %w[image/png image/vnd.microsoft.icon].freeze
|
2020-01-02 16:07:38 -05:00
|
|
|
|
2017-09-27 09:03:49 -04:00
|
|
|
def extension_whitelist
|
2018-05-17 13:00:32 -04:00
|
|
|
EXTENSION_WHITELIST
|
2017-09-27 09:03:49 -04:00
|
|
|
end
|
|
|
|
|
2020-03-12 14:09:28 -04:00
|
|
|
def content_type_whitelist
|
|
|
|
MIME_WHITELIST
|
|
|
|
end
|
|
|
|
|
2017-09-26 09:02:00 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def filename_for_different_format(filename, format)
|
|
|
|
filename.chomp(File.extname(filename)) + ".#{format}"
|
|
|
|
end
|
2017-09-26 03:51:24 -04:00
|
|
|
end
|