[Web-SIG] [extension] x-wsgiorg.flush

Phillip J. Eby pje at telecommunity.com
Thu Oct 4 16:44:15 CEST 2007


At 04:10 PM 10/4/2007 +0200, Manlio Perillo wrote:
>Graham Dumpleton ha scritto:
> > [...]
> >> The idea was to allow an application to change its mind about the
> >> headers until it had committed to writing data.  That is, to allow
> >> the application to do error handling for as long as possible before
> >> the server has to do it.
> >
> > But once you have called start_response() you cant call it a second
> > time to change the values so how could the application change its
> > mind?
>
>In my implementation of WSGI for nginx, start_response setups the
>headers on the request object, but calls ngx_http_send_header only when
>the first not empty string is yielded.
>
>This means that if an error occurs, the "old" headers are kept in the
>response (and sent to the client); nginx will simply change the status
>code to '500 INTERNAL ERROR'.

It's not clear to me from this statement whether you're supporting 
the exc_info argument as described here:

http://www.python.org/dev/peps/pep-0333/#the-start-response-callable

and here:

http://www.python.org/dev/peps/pep-0333/#error-handling




More information about the Web-SIG mailing list