[Web-SIG] Latest WSGI Draft
Phillip J. Eby
pje at telecommunity.com
Mon Aug 23 18:16:32 CEST 2004
At 10:43 AM 8/23/04 -0500, Ian Bicking wrote:
>Phillip J. Eby wrote:
>>>Well, let's say mod_python adds two extensions. One is to do a local
>>>redirect, the other is to do a recursive call. The local redirect would
>>>be in wsgi.extensions (if it existed), but the recursive call would
>>>not. With wsgi.extensions, the middleware would eliminate the local
>>>redirect, and the application would be forced to use the recursive call
>>>and write out the result of that. Which is what you would want, because
>>>then the middleware would have an opportunity to modify the output.
>>
>>In that case, why not have the local_redirect function require the
>>start_response callable as one of its parameters? It can then refuse if
>>the output has been captured by middleware.
>
>How can it tell output is going to be captured?
If 'start_response' is a different 'start_response' than the one it gave
the application. A middleware component has no need to replace
'start_response' unless it needs to control the output in some way. Thus,
using any extension API that allows direct output would be bypassing
middleware in that case.
More information about the Web-SIG
mailing list