incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r980055 - /incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb
Date Wed, 28 Jul 2010 13:48:49 GMT
Author: mfojtik
Date: Wed Jul 28 13:48:48 2010
New Revision: 980055

URL: http://svn.apache.org/viewvc?rev=980055&view=rev
Log:
Generate escaped URL's to handle names with spaces.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

Modified:
    incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb

Modified: incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb?rev=980055&r1=980054&r2=980055&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb (original)
+++ incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb Wed Jul 28 13:48:48 2010
@@ -1,3 +1,5 @@
+require 'uri'
+
 module Sinatra
   module UrlForHelper
     # Construct a link to +url_fragment+, which should be given relative to
@@ -30,7 +32,8 @@ module Sinatra
       else
         raise TypeError, "Unknown url_for mode #{mode}"
       end
-      "#{base}#{url_fragment}"
+      url_escape = URI.escape(url_fragment)
+      "#{base}#{url_escape}"
     end
 
     def root_url



Mime
View raw message