Ticket #12186: django-get_full_path.patch

File django-get_full_path.patch, 1.5 KB (added by Oldřich Jedlička, 14 years ago)

Proposed fix of the problem

  • core/handlers/modpython.py

    diff -ur django.orig/core/handlers/modpython.py django/core/handlers/modpython.py
    old new  
    6666    def get_full_path(self):
    6767        # RFC 3986 requires self._req.args to be in the ASCII range, but this
    6868        # doesn't always happen, so rather than crash, we defensively encode it.
    69         return '%s%s' % (self.path, self._req.args and ('?' + iri_to_uri(self._req.args)) or '')
     69        return iri_to_uri('%s%s' % (self.path, self._req.args and ('?' + iri_to_uri(self._req.args)) or ''))
    7070
    7171    def is_secure(self):
    7272        try:
  • core/handlers/wsgi.py

    diff -ur django.orig/core/handlers/wsgi.py django/core/handlers/wsgi.py
    old new  
    122122    def get_full_path(self):
    123123        # RFC 3986 requires query string arguments to be in the ASCII range.
    124124        # Rather than crash if this doesn't happen, we encode defensively.
    125         return '%s%s' % (self.path, self.environ.get('QUERY_STRING', '') and ('?' + iri_to_uri(self.environ.get('QUERY_STRING', ''))) or '')
     125        return iri_to_uri('%s%s' % (self.path, self.environ.get('QUERY_STRING', '') and ('?' + iri_to_uri(self.environ.get('QUERY_STRING', ''))) or ''))
    126126
    127127    def is_secure(self):
    128128        return 'wsgi.url_scheme' in self.environ \
Back to Top