#7581: Middleware accessing HttpResponse.content breaks streaming HttpResponse
objects.
-------------------------------------+-------------------------------------
     Reporter:  mrmachine            |                    Owner:  ccahoon
         Type:  New feature          |                   Status:  new
    Component:  Core (Other)         |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  stream HttpResponse  |             Triage Stage:  Accepted
  Content-Length                     |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by mrmachine):

 I've updated this patch on a branch at GitHub.

 https://github.com/thirstydigital/django/tree/tickets/7581-streaming-
 response-middleware

 If somebody can provide some concrete direction on the desired approach to
 resolve this (BDFL decision?), I'll try to add docs and tests as well.

 FYI, I've been using this patch in various incarnations for 4 years in
 production environments without any problems.

 My vote is still for allowing middleware to ask the response if it is
 streaming (generator as content) or not, and act accordingly. Either by
 changing their behaviour (to be compatible with streaming responses),
 doing nothing (to avoid breaking a streaming response), or forcing the
 response to consume the content (breaking the streaming response, but
 ensuring that the middleware always runs).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/7581#comment:29>
Django <https://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 https://groups.google.com/groups/opt_out.


Reply via email to