#14035: Cannot access POST after request.encoding was set to a custom value
------------------------------------+---------------------------------------
          Reporter:  zimnyx         |         Owner:  nobody
            Status:  reopened       |     Milestone:        
         Component:  HTTP handling  |       Version:  SVN   
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by zimnyx):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 What you mean by modifying request here? I'm just setting request.encoding
 to encoding which I assume client will use. It's common issue if you
 obtain forms "from outside" your pages.

 In fact Django HttpRequest is designed to handle encoding switching on
 fly:
 {{{
     def _set_encoding(self, val):
         """
         Sets the encoding used for GET/POST accesses. If the GET or POST
         dictionary has already been created, it is removed and recreated
 on the
         next access (so that it is decoded correctly).
         """
         self._encoding = val
         if hasattr(self, '_get'):
             del self._get
         if hasattr(self, '_post'):
             del self._post

     encoding = property(_get_encoding, _set_encoding)
 }}}

 In fact this encoding switching works fine when form data is encoded using
 "application/x-www-form-urlencoded". My point is that it '''doesn't work
 for "multipart/form-data"'''.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14035#comment:2>
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-upda...@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