#15066: GzipMiddleware does not work with generator-created responses
---------------------------------------------+------------------------------
 Reporter:  Andreas Sommer <[email protected]>  |       Owner:  nobody    
   Status:  new                              |   Milestone:            
Component:  Uncategorized                    |     Version:  SVN       
 Keywords:  gzip                             |       Stage:  Unreviewed
Has_patch:  1                                |  
---------------------------------------------+------------------------------
 With a response like

 {{{
 def gen():
     yield "something"
 return HttpResponse(gen())
 }}}

 and a HTTP 200 status code, the `GzipMiddleware` will always return an
 empty response because it accesses the `response.content` property twice.
 That means the `_get_content` getter applies `''.join` twice to the
 generator, but a generator can only be iterated once.

 See patch proposal.

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