﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11322	Description of process_response Middleware method incorrect	Michael Malone	nobody	"The [http://docs.djangoproject.com/en/dev/topics/http/middleware/#process-response Middleware documentation] says that if some middleware returns an {{{HttpResponse}}} object from its  {{{process_response()}}} method, other middleware that follows it in the chain will not be executed. While this is true for the {{{process_request()}}} and {{{process_view()}}} methods, it is not true for {{{process_response()}}} (see relevant code for how [http://code.djangoproject.com/browser/django/trunk/django/core/handlers/base.py#L71 request], [http://code.djangoproject.com/browser/django/trunk/django/core/handlers/base.py#L85 view], and [http://code.djangoproject.com/browser/django/trunk/django/core/handlers/wsgi.py#L243 response] middleware is handled). In fact, the {{{process_response()}}} method '''must''' return an {{{HttpResponse}}} object, as its return value is used as the {{{response}}} object passed to any other middleware, and eventually rendered as an HTTP response.

I also think it's worth noting in the description of {{{process_response()}}} that, if present, this method will '''always''' be called for '''every''' response, even if request middleware that precedes it in the middleware stack short circuits and returns an {{{HttpResponse}}}.

Since both of these appear to be intentional design decisions I've attached a small documentation patch that addresses both issues."		closed	Documentation	dev		fixed	middleware documentation response	mjmalone@…	Ready for checkin	1	0	0	0	0	0
