Проставляем правильный content_type для svg

This commit is contained in:
Nastia Gorokhova-Alekseeva
2022-08-31 18:59:02 +03:00
parent b1441563f7
commit 4a5764c347
2 changed files with 2 additions and 1 deletions

View File

@@ -414,7 +414,7 @@ module Paperclip
end
def post_process #:nodoc:
return unless content_type.match(/image/)
return if !content_type.include?('image') || content_type.include?('svg')
return if queued_for_write[:original].nil?
instance.run_paperclip_callbacks(:post_process) do

View File

@@ -20,6 +20,7 @@ module Paperclip
when %r"html?" then "text/html"
when "csv", "xml", "css", "js" then "text/#{type}"
when "liquid" then "text/x-liquid"
when 'svg' then 'image/svg+xml'
else "application/x-#{type}"
end
end