Author: mtredinnick
Date: 2009-03-08 04:58:40 -0500 (Sun, 08 Mar 2009)
New Revision: 9996

Modified:
   django/trunk/django/core/handlers/wsgi.py
Log:
Fixed #9469 -- Apply the fix from r9189 to the WSGI handler as well.

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

Modified: django/trunk/django/core/handlers/wsgi.py
===================================================================
--- django/trunk/django/core/handlers/wsgi.py   2009-03-08 09:41:37 UTC (rev 
9995)
+++ django/trunk/django/core/handlers/wsgi.py   2009-03-08 09:58:40 UTC (rev 
9996)
@@ -10,7 +10,7 @@
 from django.core.handlers import base
 from django.core.urlresolvers import set_script_prefix
 from django.utils import datastructures
-from django.utils.encoding import force_unicode
+from django.utils.encoding import force_unicode, iri_to_uri
 
 # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
 STATUS_CODE_TEXT = {
@@ -120,7 +120,9 @@
             (get, post, cookies, meta)
 
     def get_full_path(self):
-        return '%s%s' % (self.path, self.environ.get('QUERY_STRING', '') and 
('?' + self.environ.get('QUERY_STRING', '')) or '')
+        # RFC 3986 requires query string arguments to be in the ASCII range.
+        # Rather than crash if this doesn't happen, we encode defensively.
+        return '%s%s' % (self.path, self.environ.get('QUERY_STRING', '') and 
('?' + iri_to_uri(self.environ.get('QUERY_STRING', ''))) or '')
 
     def is_secure(self):
         return 'wsgi.url_scheme' in self.environ \


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to