1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

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
This commit is contained in:
Adrian Holovaty
2005-09-02 19:39:47 +00:00
parent 92918b5ed7
commit 5bdf1da730
3 changed files with 29 additions and 11 deletions

View File

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