Ticket #2078: urlencode.diff
File urlencode.diff, 1.0 KB (added by , 18 years ago) |
---|
-
django/http/__init__.py
1 1 from Cookie import SimpleCookie 2 2 from pprint import pformat 3 from urllib import urlencode 3 from urllib import urlencode, quote 4 4 from django.utils.datastructures import MultiValueDict 5 5 6 RESERVED_CHARS="!*'();:@&=+$,/?%#[]" 7 6 8 try: 7 9 # The mod_python version is more efficient, so try importing it first. 8 10 from mod_python.util import parse_qsl … … 241 243 class HttpResponseRedirect(HttpResponse): 242 244 def __init__(self, redirect_to): 243 245 HttpResponse.__init__(self) 244 self['Location'] = redirect_to246 self['Location'] = quote(redirect_to, safe=RESERVED_CHARS) 245 247 self.status_code = 302 246 248 247 249 class HttpResponsePermanentRedirect(HttpResponse): 248 250 def __init__(self, redirect_to): 249 251 HttpResponse.__init__(self) 250 self['Location'] = redirect_to252 self['Location'] = quote(redirect_to, safe=RESERVED_CHARS) 251 253 self.status_code = 301 252 254 253 255 class HttpResponseNotModified(HttpResponse):