#14021: GZipMiddleware is incompatible with iterator-style HttpResponse objects
---------------------------+------------------------------------------------
 Reporter:  jamesh         |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.2       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 An HttpResponse object that has been initialised with an iterator can only
 have its content read once.  The first line of
 GZipMiddleware.process_response reads the response body and throws it
 away:

     {{{
 if response.status_code != 200 or len(response.content) < 200:
     return response
 }}}

 After this point, whether the middleware decides to compress the body or
 not, the content has been lost.

 If the middleware encounters such a response, it should make sure it reads
 the body at most once.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14021>
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