[Web-SIG] Internal redirect using Location with absolute pathand status of 200.
Robert Brewer
fumanchu at amor.org
Sat May 26 18:05:25 CEST 2007
Graham Dumpleton wrote:
> The problem then as above is what does one do at
> the boundary between a WSGI application and the
> web server hosting it? Do you just always assume
> a WSGI application provides an error page, or allow
> some way that a WSGI application can defer to the
> web server the task of generating an error page
> instead?
The web server should not be trying to correct what
the application gives it, except as absolutely necessary
to get the response on the wire, or obey the HTTP spec
(and even that's questionable). If you want consistent
error pages across an entire application or site, write
a piece of WSGI middleware which does that and explicitly
include it in your middleware graph.
To quote the PEP:
In general, servers and gateways should "play dumb"
and allow the application complete control over its output.
They should only make changes that do not alter the
effective semantics of the application's response.
It is always possible for the application developer
to add middleware components to supply additional
features, so server/gateway developers should be
conservative in their implementation. In a sense,
a server should consider itself to be like an HTTP
"gateway server", with the application being an
HTTP "origin server". (See RFC 2616, section 1.3,
for the definition of these terms.)
Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/web-sig/attachments/20070526/9875eebf/attachment.htm
More information about the Web-SIG
mailing list