[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[snapshot/master] we want to url-encode the srcpackage name when we redirect to it



---
 web/app/snapshot/controllers/package.py |    2 +-
 web/app/snapshot/lib/control_helpers.py |    6 ------
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/web/app/snapshot/controllers/package.py b/web/app/snapshot/controllers/package.py
index c3240ea..166b180 100644
--- a/web/app/snapshot/controllers/package.py
+++ b/web/app/snapshot/controllers/package.py
@@ -55,7 +55,7 @@ class PackageController(BaseController):
 
     def root(self):
         if 'src' in request.params:
-            return redirect_to(unicode_encode(request.params['src'] + "/"))
+            return redirect_to(urllib.quote(request.params['src'] + "/"))
         elif 'cat' in request.params:
             try:
                 #etag_cache( g.shm.packages_get_etag(self._db()) )
diff --git a/web/app/snapshot/lib/control_helpers.py b/web/app/snapshot/lib/control_helpers.py
index 8e31cd8..630778a 100644
--- a/web/app/snapshot/lib/control_helpers.py
+++ b/web/app/snapshot/lib/control_helpers.py
@@ -40,12 +40,6 @@ def build_url_archive_ym_list(archive, year, month):
     url += "?year=%d&month=%d"%ym
     return url
 
-def unicode_encode(path):
-    if isinstance(path, unicode):
-        return path.encode('utf-8')
-    else:
-        return path
-
 def set_expires(max_age):
     response.expires = datetime.datetime.now() + datetime.timedelta(seconds = max_age);
     response.cache_control = 'public, max-age=%d'%max_age
-- 
1.5.6.5


Reply to: