httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <>
Subject Re: How does set status code in filter work
Date Mon, 10 Dec 2007 21:24:03 GMT
John Zhang wrote:
> Joe,
>     Thanks for you rreply, but I do not quite
> understand "Your filter should run before the content
> type is set".  Could you elaberated on that? My filter
> is an output filter.

The filter types are AP_FTYPE_ (followed by one of the following )
two most common ones are AP_FTYPE_RESOURCE, and AP_FTYPE_CONTENT_SET. 
The difference between the two is one (RESOURCE) runs prior to the
Content-Type header being set.  (Meaning they can change any of those
headers).  The other (CONTENT_SET) runs after that header is set, and
are not supposed to change that header (I expect there are other
headers, such as the status, that may also be effected here, but I do
not know for sure).  It is in your register_hook function that you
declare when you want your filter to be run that those are specified.

>     Also, if I issue a redirect in my (output) filter
> to (say /errors/HTTP_FORBIDDEN.html) and I am a filter
> for .html, will I be called in loading the error page?

Error pages do not run in the standard filter chain by default.  If you
want your filter running on the error HTML files in addition to others,
you would have to use an error_filter hook as well.

Joseph Lewis <>
"Divide the fire, and you will sooner put it out." - Publius Syrus

View raw message