Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix Spree CDN when no host is set at all (#12017)

Damian Legawiec2ddfedaa8423
diff --git a/core/config/routes.rb b/core/config/routes.rb
index ff404b3d0e..ed68cd6243 100644
--- a/core/config/routes.rb
+++ b/core/config/routes.rb
@@ -4,7 +4,8 @@ Rails.application.routes.draw do
direct :cdn_image do |model, options|
options[:host] = Spree.cdn_host if Spree.cdn_host.present?
options[:host] ||= Rails.application.routes.default_url_options[:host]
- options[:host] ||= 'localhost' if Rails.env.development?
+
+ options[:only_path] = true if options[:host].blank?
if model.blob.service_name == 'cloudinary' && defined?(Cloudinary)
if model.class.method_defined?(:has_mvariation)