#5241: Response middleware runs too early for streaming responses
-------------------------------------+-------------------------------------
Reporter: bittor | Owner: aaugustin
Type: Bug | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
internationalization, progresive | Needs documentation: 0
rendering | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by aaugustin):
After thinking about this problem for some time, I don't think it's
feasible to run the middleware after starting a streaming response.
Since you already started sending output:
- You cannot change headers — the primary task of `process_response`
- You cannot handle exceptions gracefully — the primary task of
`process_exception`
So the answer here is to stop deactivating the translation in
`process_response`.
--
Ticket URL: <https://code.djangoproject.com/ticket/5241#comment:16>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.