deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/7] git commit: Core: simplify how we remove matrix params from the URL
Date Wed, 12 Sep 2012 07:35:33 GMT
Updated Branches:
  refs/heads/master 77f879ae3 -> 1761b0c38


Core: simplify how we remove matrix params from the URL


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/1761b0c3
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/1761b0c3
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/1761b0c3

Branch: refs/heads/master
Commit: 1761b0c38fc7433fca6e6b5f68da7c8945c58112
Parents: 17b218b
Author: David Lutterkort <lutter@redhat.com>
Authored: Thu Sep 6 16:54:43 2012 -0700
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Wed Sep 12 09:35:53 2012 +0200

----------------------------------------------------------------------
 server/lib/sinatra/rack_matrix_params.rb |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1761b0c3/server/lib/sinatra/rack_matrix_params.rb
----------------------------------------------------------------------
diff --git a/server/lib/sinatra/rack_matrix_params.rb b/server/lib/sinatra/rack_matrix_params.rb
index 8a489d3..50db4a0 100644
--- a/server/lib/sinatra/rack_matrix_params.rb
+++ b/server/lib/sinatra/rack_matrix_params.rb
@@ -79,15 +79,9 @@ module Rack
       #         does not trip over them
 
       # (1) Rewrite current path by stripping all matrix params from it
-      if env['REQUEST_PATH'] == '/'
-        env['REQUEST_URI'] = env['REQUEST_PATH']
-        env['REQUEST_PATH'] = env['PATH_INFO']
-      end
-
-      # This is needed for OpenShift deployment / Passenger
-      if env['REQUEST_PATH']
-        env['REQUEST_PATH'] = env['REQUEST_PATH'].remove_matrix_params
-        env['PATH_INFO'] = env['PATH_INFO'].remove_matrix_params
+      ['REQUEST_PATH', 'REQUEST_URI', 'PATH_INFO'].select { |k|
+        env[k] }.each do |k|
+        env[k] = env[k].remove_matrix_params
       end
 
       # (2) Append the matrix params to the 'normal' request params


Mime
View raw message