[Django] #28430: Response is not necessarrily rendered when response middlewares are applied

14 views
Skip to first unread message

Django

unread,
Jul 24, 2017, 7:55:51 AM7/24/17
to django-...@googlegroups.com
#28430: Response is not necessarrily rendered when response middlewares are applied
--------------------------------------------+------------------------
Reporter: Sébastien Diemer | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
According to
[https://github.com/django/django/blob/master/django/core/handlers/base.py#L90
this part of the code], a request is not necessarily rendered when
response middlewares are applied.
However
[https://github.com/django/django/blob/master/django/middleware/common.py#L137
this part of the code] of CommonMiddleware assumes that the response is
already rendered (taking its content-length).

There seems to be an inconsistency here.

--
Ticket URL: <https://code.djangoproject.com/ticket/28430>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 24, 2017, 7:04:44 PM7/24/17
to django-...@googlegroups.com
#28430: Response is not necessarily rendered when response middlewares are applied
----------------------------------+--------------------------------------

Reporter: Sébastien Diemer | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: worksforme

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => worksforme


Comment:

2f615b10e6330d27dccbd770a4628200044acf70 is the commit that allowed
`TemplateResponse` to be returned from error handlers. The response in
`test_handler_renders_template_response` has a Content-Length so I don't
see the issue here. Feel free to reopen with specific steps to reproduce a
problem.

--
Ticket URL: <https://code.djangoproject.com/ticket/28430#comment:2>

Django

unread,
Jul 25, 2017, 5:07:12 AM7/25/17
to django-...@googlegroups.com
#28430: Response is not necessarily rendered when response middlewares are applied
----------------------------------+--------------------------------------

Reporter: Sébastien Diemer | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: worksforme

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------

Comment (by Sébastien Diemer):

Ok, I wasn't able to replicate the issue on a simple Django project. Thank
you for your time.

--
Ticket URL: <https://code.djangoproject.com/ticket/28430#comment:3>

Reply all
Reply to author
Forward
0 new messages