[mod_python] Sending back headers with 4xx responses

Deron Meranda deron.meranda at gmail.com
Wed May 31 12:45:45 EDT 2006


> You have to raise these.
>
> For example:
>
>     if status >= 200 and status < 300:
>         return apache.OK
>     else:
>         raise apache.SERVER_RETURN, status

No, that's not it.  Either way the response code is sent back,
but not the headers.  It definitely appears to be a problem only
for 1xx, 4xx and 5xx codes.  For any 2xx or 3xx codes,
headers go through as expected.

At least for the 4/5xx codes, perhaps the problem is the way
Apache really does an internal redirect to the appropriate
error page?  Is there any way to pass information or headers
on to those?

Whatever the reason, I seem unable to send back a Content-Range
header for a 416 as recommended by the RFC.
-- 
Deron Meranda


More information about the Mod_python mailing list