incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 07/10] Preserving extension as part of ID
Date Wed, 29 Sep 2010 14:18:25 GMT
From: Michal Fojtik <mfojtik@redhat.com>

---
 server/lib/sinatra/respond_to.rb |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/server/lib/sinatra/respond_to.rb b/server/lib/sinatra/respond_to.rb
index b4efac4..890890d 100644
--- a/server/lib/sinatra/respond_to.rb
+++ b/server/lib/sinatra/respond_to.rb
@@ -69,8 +69,7 @@ module Sinatra
         # Remove extension from URI
         # Extension will be available as a 'extension' method (extension=='txt')
        
-        request.path_info.sub! %r{\.([^\./]+)$}, ''
-        extension $1
+        extension request.path_info.match(/\.([^\.\/]+)$/).to_a.first
 
         # If ?format= is present, ignore all Accept negotiations because
         # we are not dealing with browser
-- 
1.7.2.3


Mime
View raw message