[albatross-users] HTTP Status handling fixes

Michael C. Neel neel at mediapulse.com
Sat Jan 10 02:47:05 EST 2004


This is a problem I just had to address on our systems, because the
traceback being a 200 OK page led search engines to (rightfuly) index
the page.  I set template load errors to 404 and all others to 500 it a
cusomt app class we use.

A problem did arise relating to mod_python.  If the return value of the
mod_python handler is other than 200 OK, apache takes over and does it's
own error page, (or does the redirect to a ErrorDocument if one is
setup).  This however prevent you from ever seeing traceback or
traceback.html.  I brought this issue up on the mod_python list, and it
seems that version 3.x has a member req.status you can use to set the
correct status and still return apache.OK; but this doesn't seem to be
in 2.x mod_python (1.3x Apaches), leaving those of us not running Apache
2.x on every system left to work around the missing piece.

Grisha hasn't hid the fact he no longer wishes to maintain mod_python
for apache 1.3; so barring any major security problems I don't see
changes coming for a while to mod_python 2.x.

Sine your in the handle_execption ( =D )... the custom app we have
allows us to define the name of the traceback.html file so that it
doesn't have to be called traceback.html.  Still same logic, spew on no
file, so tis allows us to toggle traceback errors through httpd.conf
options, so that our beta server spews while live has a pretty error
message - without the need for us to remember to mv traceback.html into
the templates folder after we sync to live (because we forget, lol).
Also, it has a toggle for a formatted email to be sent of the spew that
would have occurred, plus headers, request connection details, and field
values.  So on live we get emails of errors, but we don't enable this on
beta.  Like I said, since you were already in there...

=)

Mike

Actually, when you get to a point of putting up a rc you think will be
up for a bit, I'll work on some of this myself, so don't feel pressured
to do so.  I've got no problems with some one tweaking my patch later,
the goal was to get the feature in there =)



More information about the Albatross-users mailing list