Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 49E40D2FD for ; Fri, 3 Aug 2012 09:10:15 +0000 (UTC) Received: (qmail 79995 invoked by uid 500); 3 Aug 2012 09:10:15 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 79957 invoked by uid 500); 3 Aug 2012 09:10:14 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 79916 invoked by uid 99); 3 Aug 2012 09:10:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 09:10:13 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 09:10:06 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7399j6K021921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Aug 2012 05:09:45 -0400 Received: from dhcp-29-121.brq.redhat.com (dhcp-29-121.brq.redhat.com [10.34.29.121]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7399fsV017068 for ; Fri, 3 Aug 2012 05:09:44 -0400 From: mfojtik@redhat.com To: dev@deltacloud.apache.org Subject: [PATCH core 2/5] Core: Fixed url_for helper when used different frontend Date: Fri, 3 Aug 2012 11:10:39 +0200 Message-Id: <1343985042-72967-3-git-send-email-mfojtik@redhat.com> In-Reply-To: <1343985042-72967-1-git-send-email-mfojtik@redhat.com> References: <1343985042-72967-1-git-send-email-mfojtik@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 From: Michal Fojtik * 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 --- 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