deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH] EC2: Fixed incorrectly mapped root_url
Date Tue, 04 Sep 2012 20:25:59 GMT
From: Michal Fojtik <mfojtik@redhat.com>

* EC2 frontend does not use Rabbit DSL but regular
  Sinatra::Base class. Seems like this class does
  preserve original Rack mapping in the root_url
  which cause double-mapping (/ec2/ec2).

* Note: This patch is just a hot-fix, we need to
  investigate Rack mounting.
---
 server/lib/ec2/server.rb | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/server/lib/ec2/server.rb b/server/lib/ec2/server.rb
index 15b6000..a6c3089 100644
--- a/server/lib/ec2/server.rb
+++ b/server/lib/ec2/server.rb
@@ -38,13 +38,14 @@ module Deltacloud::EC2
     enable :xhtml
     enable :dump_errors
     enable :show_errors
-    enable :method_override
     disable :show_exceptions
 
-    set :version, Deltacloud[:ec2].version
-    set :root_url, Deltacloud[:ec2].root_url
+    set :config, Deltacloud[:ec2]
+    set :root_url, config.root_url
+    set :root_path, config.root_url
+    set :version, config.version
     set :root, File.join(File.dirname(__FILE__), '..', '..')
-    set :views, File.join(File.dirname(__FILE__), 'views')
+    set :public_folder, root + '/public'
 
     error Deltacloud::EC2::QueryParser::InvalidAction do
       status 400
@@ -55,7 +56,7 @@ module Deltacloud::EC2
       headers 'Server' => 'Apache-Deltacloud-EC2/' + settings.version
     end
 
-    get Deltacloud[:ec2].root_url do
+    get '/' do
       headers 'Connection' => 'close'
       unless params['Action']
         redirect settings.root_url, 301
-- 
1.7.11.4


Mime
View raw message