From e879aa1bed035a9bf847079b503e154723b23e2f Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Mon, 26 Oct 2020 20:27:42 +0000 Subject: [PATCH] Switch to s3_alias_url that enabble virtual host type of path --- app/models/spree/image.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/spree/image.rb b/app/models/spree/image.rb index a8ea22038a..57597fe378 100644 --- a/app/models/spree/image.rb +++ b/app/models/spree/image.rb @@ -62,10 +62,9 @@ module Spree ActiveSupport::JSON.decode(Spree::Config[:s3_headers])) set_attachment_attributes(:bucket, Spree::Config[:s3_bucket]) - # When using S3, we set the URL on property s3_host_name - set_attachment_attributes(:s3_host_name, attachment_definitions[:attachment][:url]) - set_attachment_attributes(:url, ":s3_domain_url") - # :s3_alias_url + # We use :s3_alias_url (virtual host url style) and set the URL on property s3_host_alias + set_attachment_attributes(:s3_host_alias, attachment_definitions[:attachment][:url]) + set_attachment_attributes(:url, ":s3_alias_url") else attachment_definitions[:attachment].delete :storage end