You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2010/07/28 15:48:49 UTC

svn commit: r980055 - /incubator/deltacloud/trunk/server/lib/sinatra/url_for.rb

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 <cl...@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