#15152: Common middleware raises UnicodeDecodeError if receives specially 
formatted
unicode-like query string
-------------------------------------+--------------------------------------
          Reporter:  Loststylus      |         Owner:  nobody           
            Status:  new             |     Milestone:  1.3              
         Component:  Core framework  |       Version:  1.2              
        Resolution:                  |      Keywords:  common middleware
             Stage:  Unreviewed      |     Has_patch:  0                
        Needs_docs:  0               |   Needs_tests:  0                
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Comment (by Loststylus):

 Temporary workaround (middleware should be added befor common middleware):
 {{{
 #!python
 class RequestCheckMiddleware(object):

     def process_request(self, request):

         try:
             u'%s' % request.META.get('QUERY_STRING','')
         except UnicodeDecodeError:
             response = HttpResponse()
             response.status_code = 400  #Bad Request
             return response

         return None
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15152#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to