Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #9469 -- Apply the fix from r9189 to the WSGI handler a…

…s well.

This is a defensive encoding fix. No functionality change for correct URLs.
Patch from magneto.

Backport of r9996 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9999 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 244bb7e6012d0cc37557efaee90adb5c7e885306 1 parent 7dcf651
Malcolm Tredinnick authored March 08, 2009

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  django/core/handlers/wsgi.py
6  django/core/handlers/wsgi.py
@@ -10,7 +10,7 @@
10 10
 from django.core.handlers import base
11 11
 from django.core.urlresolvers import set_script_prefix
12 12
 from django.utils import datastructures
13  
-from django.utils.encoding import force_unicode
  13
+from django.utils.encoding import force_unicode, iri_to_uri
14 14
 
15 15
 # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
16 16
 STATUS_CODE_TEXT = {
@@ -120,7 +120,9 @@ def __repr__(self):
120 120
             (get, post, cookies, meta)
121 121
 
122 122
     def get_full_path(self):
123  
-        return '%s%s' % (self.path, self.environ.get('QUERY_STRING', '') and ('?' + self.environ.get('QUERY_STRING', '')) or '')
  123
+        # RFC 3986 requires query string arguments to be in the ASCII range.
  124
+        # 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 '')
124 126
 
125 127
     def is_secure(self):
126 128
         return 'wsgi.url_scheme' in self.environ \

0 notes on commit 244bb7e

Please sign in to comment.
Something went wrong with that request. Please try again.