httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Zhang <john_zzh...@yahoo.com>
Subject Re: How does set status code in filter work
Date Tue, 11 Dec 2007 22:11:34 GMT
Thanks a lot, Joe!

--- Joe Lewis <joe@joe-lewis.com> wrote:

> 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 )
> RESOURCE, CONTENT_SET, PROTOCOL, TRANSCODE,
> CONNECTION or NETWORK.  The
> 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.
> 
> Joe
> -- 
> Joseph Lewis <http://sharktooth.org/>
> "Divide the fire, and you will sooner put it out." -
> Publius Syrus
> 


Mime
View raw message