Skip to content

Commit

Permalink
Fixed #9224 -- Prevent a crash when certain query strings are sent using
Browse files Browse the repository at this point in the history
modpython.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9189 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Oct 7, 2008
1 parent cd8eeaa commit 2ae3637
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django/core/handlers/modpython.py
Expand Up @@ -6,7 +6,7 @@
from django.core.handlers.base import BaseHandler
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
from django.utils.encoding import force_unicode, smart_str
from django.utils.encoding import force_unicode, smart_str, iri_to_uri

# NOTE: do *not* import settings (or any module which eventually imports
# settings) until after ModPythonHandler has been called; otherwise os.environ
Expand Down Expand Up @@ -64,7 +64,9 @@ def __repr__(self):
unicode(cookies), unicode(meta)))

def get_full_path(self):
return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '')
# RFC 3986 requires self._req.args to be in the ASCII range, but this
# doesn't always happen, so rather than crash, we defensively encode it.
return '%s%s' % (self.path, self._req.args and ('?' + iri_to_uri(self._req.args)) or '')

def is_secure(self):
try:
Expand Down

0 comments on commit 2ae3637

Please sign in to comment.