Rob Bloodgood wrote:
> I'm using mod_access for Allow/Deny, and on Deny it of course responds
> to the client with FORBIDDEN. I've experimented with using a fixup
> handler to change this to a REDIRECT, 

I don't see how that could happen - once you return something other than OK,
DECLINED, or DONE apache skips right to the logging phase (after sending
some canned content or your configured ErrorDocument).  fixups should never
be run after returning FORBIDDEN, SERVER_ERROR, or anything similar from a
phase prior-to fixups themselves.

> but when I access the request object,
> $r->status seems to *always* be 200 OK.

as it should be.  r->status is set to HTTP_OK at the start of the request
and remains so throughout, until you hit the error cycle (like
ErrorDocuments).  specifically, returning FORBIDDEN (or anything else) does
not change r->status.

> 
> I haven't been able to locate an API call that returns the "true"
> status by examining the source and autogenerated docs, 

that's because the status of the request is always 200 until Apache actually
writes the content to the wire - the real status is communicated via the
return from ap_process_request_internal.  see ap_process_request in
http_request.c and ap_process_request_internal in request.c.


>     if ($r->status == Apache::FORBIDDEN) {

this will never be true.  well, not never - if Apache tries to serve an
ErrorDocument and _that_ returns an error, then it will be true (and you'll
get the "additionally, a 500..." type messages), but you can't see that via
mod_perl.  well, you might be able to with exception handlers, but I don't
know if we have a hook into that yet.

HTH

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to