From 3b5e8b9a2e1ae4323720191b3143d0be97cc95c2 Mon Sep 17 00:00:00 2001 From: Tommaso Visconti Date: Mon, 14 Jan 2013 10:56:57 +0100 Subject: [PATCH] Fixes the error "bad component(expected host component): localhost:3000" --- app/controllers/spree/checkout_controller_decorator.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index 6b3e5cd..e7b78a8 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -192,7 +192,12 @@ def paypal_finish private def asset_url(_path) - URI::HTTP.build(:path => ActionController::Base.helpers.asset_path(_path), :host => Spree::Config[:site_url].strip).to_s + host = Spree::Config[:site_url].strip + unless host.match /https?:\/\// + host = "http://#{host}" + end + uri = URI.parse(host) + URI::HTTP.build(:path => ActionController::Base.helpers.asset_path(_path), :host => uri.host, :port => (uri.port || 80)).to_s end def record_log(payment, response)