You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/08/03 11:10:39 UTC
[PATCH core 2/5] Core: Fixed url_for helper when used different frontend
From: Michal Fojtik <mf...@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 <mf...@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