On Sun, 20 May 2001, Graham Leggett wrote:
> [EMAIL PROTECTED] wrote:
>
> > > So the question is - which hook should be called to fiddle with the
> > > headers after the content generator runs, but before the headers are
> > > sent to the network, whether a body exists or not...?
> >
> > You are using the wrong kind of output filter. Take a look at how
> > http_header_filter is added, and just copy that model.
>
> I changed the filter type to AP_FTYPE_HTTP_HEADER, but now the filter
> runs too late and no headers are changed.
>
> Looking closer at the core code, in modules/http/http_request.c and
> server/protocol.c:
>
> r->output_filters = conn->output_filters;
> r->input_filters = conn->input_filters;
>
> ap_add_output_filter("BYTERANGE", NULL, r, r->connection);
> ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
> ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
>
> All three of the above filters are AP_FTYPE_HTTP_HEADER filters - this
> means it's impossible to add any more AP_FTYPE_HTTP_HEADER filters,
> because they would always be added after the HTTP_HEADER filter ran,
> thus they cannot do anything.
>
> Adding the filter in the pre_connection phase could get round this, but
> would this then break TLS, etc?
>
> How about a new hook for adding AP_FTYPE_HTTP_HEADER filters?
IMO, this should be fixed by adding the three filters above in a
core_insert_filter phase. Then, mod_headers can easily be run before the
core's insert_fitler phase. Problem solved.
Ryan
_______________________________________________________________________________
Ryan Bloom [EMAIL PROTECTED]
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------