httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: Allowing modules to add input filters is broken
Date Fri, 18 May 2001 17:04:34 GMT


> Bill Stoddard wrote:
>
> > > This doesn't work - the filter is inserted, but it never runs.
> >
> > Read Ryan's response carefully (and my earlier responses this AM).  The
> > input filter can filter the request body (not headers).
>
> When I say "filter the headers" I mean "fiddle with the contents of
> r->headers_in" after the headers have been read in.
>
> The filter is actually a body filter, but the body is passed through
> untouched.

yes, the mod_header input filter is a body filter. It is not inserted (by
ap_run_insert_filter) until -AFTER- the request headers have been read in.
The filter is being inserted after the request headers have been read in but
before any body data is read in. GET requests don't contain a body so the
input filter is not getting called.

>
> > As I (and now Ryan) have pointed out, the only way to filter headers is
to
> > hook the pre_connection hook.  But this is a really bad idea for reasons
> > mentioned in both of our previous posts.  I think the right thing to do
with
> > mod_headers is to handle the HeaderIn processing in the request fixup
hook,
> > not as a filter.
>
> The input filter needs to run after the headers are read in and put in
> r->headers, but before the content generator runs.
>

A good place to do this is in the fixup stage.

Bill



Mime
View raw message