From 89e887b44ac0b8f87a360960a8fbd4fe26eac744 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 6 Nov 2016 20:59:06 +0100 Subject: [PATCH] Fix insecure S3 URLs --- config/initializers/paperclip.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index d727612507..74aa076fed 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -1,5 +1,8 @@ if ENV['S3_ENABLED'] == 'true' - Paperclip::Attachment.default_options[:storage] = :s3 + Paperclip::Attachment.default_options[:storage] = :s3 + Paperclip::Attachment.default_options[:s3_protocol] = 'https' + Paperclip::Attachment.default_options[:url] = ':s3_domain_url' + Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' Paperclip::Attachment.default_options[:s3_credentials] = { bucket: ENV.fetch('S3_BUCKET'), @@ -7,7 +10,4 @@ if ENV['S3_ENABLED'] == 'true' secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'), s3_region: ENV.fetch('S3_REGION') } - - Paperclip::Attachment.default_options[:url] = ':s3_domain_url' - Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' end