From 5bdf1da730368a16beaa077d91457ff625f06bc4 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 2 Sep 2005 19:39:47 +0000 Subject: Fixed #394 -- Trailing-slash redirects now retain duplicate name-value query-string pairs, instead of the first of each pair. Added a QueryDict.urlencode() method to accomplish this. Updated the docs. Thanks for the good catch, mlambert git-svn-id: http://code.djangoproject.com/svn/django/trunk@613 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/middleware/common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'django/middleware') diff --git a/django/middleware/common.py b/django/middleware/common.py index 295855d73e..ee6b68be7e 100644 --- a/django/middleware/common.py +++ b/django/middleware/common.py @@ -4,7 +4,6 @@ from django.utils import httpwrappers from django.core.mail import mail_managers from django.views.core.flatfiles import flat_file import md5, os -from urllib import urlencode class CommonMiddleware: """ @@ -49,7 +48,7 @@ class CommonMiddleware: # Redirect newurl = "%s://%s%s" % (os.environ.get('HTTPS') == 'on' and 'https' or 'http', new_url[0], new_url[1]) if request.GET: - newurl += '?' + urlencode(request.GET) + newurl += '?' + request.GET.urlencode() return httpwrappers.HttpResponseRedirect(newurl) return None -- cgit v1.3