Grisha wrote ..
> 
> This sounds like a good idea, but it's probably better to push this off
> to 
> 3.3 just to veer on the side of caution.
> 
> My $0.02
> 
> Grisha

Grisha, do you remember why the following warning is present in
directive_PythonInputFilter() and directive_PythonOutputFilter() of
"mod_python.c".

    /* register the filter NOTE - this only works so long as the
       directive is only allowed in the main config. For .htaccess we
       would have to make sure not to duplicate this */

Having input/output filters be able to be specified in .htaccess
must have been considered, but there must have been some issue
with it that prevented it being done at the time.

Also, can you think of any reason why it wouldn't be reasonable
to have support for a mod_python handler being able to register
an output filter to be applied to the current request? Ie., as long
as the output filter is registered prior to the first output from the
handler, the actual output from the handler would be sent through
the filter registered from the handler itself.

Have been thinking about how practical it would be to do things
like have a handler output HTML with tags embedded which are
understood by mod_include (server side includes), and for the
handler before it output the HTML do the equivalent of:

  SetOutputFilter INCLUDES

The tags in the HTML could be stuff like "#include virtual" which
would then cause Apache to internally direct sub requests against
other mod_python handlers or static files which include stuff like
common page layouts etc.

Anyway, just toying with ideas.

Graham

> On Tue, 20 Dec 2005, Graham Dumpleton wrote:
> 
> > Anyone know if there are any technical reasons why input/output filters
> > as they exist at the moment, applying only to body content and not
> > headers, can not be specified in a .htaccess files?
> >
> > Specifically, the SetInputFilter, SetOutputFilter, AddInputFilter and
> > AddOutputFilter directives of Apache can be specified in either main
> > server configuration or .htaccess files, yet the PythonInputFilter and
> > PythonOutputFilter directives are only allowed to be specified in the
> > main server configuration.
> >
> > This is because mod_python.c contains:
> >
> >    AP_INIT_TAKE12(
> >        "PythonInputFilter", directive_PythonInputFilter, NULL, 
> > RSRC_CONF|ACCESS_CONF,
> >        "Python input filter."),
> >    AP_INIT_TAKE12(
> >        "PythonOutputFilter", directive_PythonOutputFilter, NULL, 
> > RSRC_CONF|ACCESS_CONF,
> >        "Python output filter."),
> >
> > If however I change it to:
> >
> >    AP_INIT_TAKE12(
> >        "PythonInputFilter", directive_PythonInputFilter, NULL, OR_ALL,
> >        "Python input filter."),
> >    AP_INIT_TAKE12(
> >        "PythonOutputFilter", directive_PythonOutputFilter, NULL, OR_ALL,
> >        "Python output filter."),
> >
> > it is then possible to use the mod_python directives in a .htaccess file.
> >
> > Running the code this way appears to work for both input and output filters
> > when specified in the .htaccess file without problems.
> >
> > So, does anyone know why this might be a bad idea? I can't really think
> of
> > any reasons why it shouldn't be okay. If there is some confirmation that
> > it all sounds reasonable, I'll create a JIRA issue for it to be a future
> > enhancement.
> >
> > Graham
> >

Reply via email to