deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/5] Core: Fixed url_for helper when used different frontend
Date Tue, 31 Jul 2012 12:33:26 GMT
From: Michal Fojtik <mfojtik@redhat.com>

* url_for by default check the ENV and then fallback to Deltacloud
  This patch makes it look into Sinatra 'settings' for the correct
  root_url

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/helpers/url_helper.rb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/lib/deltacloud/helpers/url_helper.rb b/server/lib/deltacloud/helpers/url_helper.rb
index 1822057..bf82867 100644
--- a/server/lib/deltacloud/helpers/url_helper.rb
+++ b/server/lib/deltacloud/helpers/url_helper.rb
@@ -96,7 +96,7 @@ module Sinatra
         else
           port = ":#{port}"
         end
-        base = "#{scheme}://#{request_host}#{port}#{request.script_name.empty? ? Deltacloud[ENV['API_FRONTEND']
|| :deltacloud].root_url : request.script_name}"
+        base = "#{scheme}://#{request_host}#{port}#{request.script_name.empty? ? settings.config.root_url
: request.script_name}"
       else
         raise TypeError, "Unknown url_for mode #{mode}"
       end
-- 
1.7.10.2


Mime
View raw message