Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-103

Implement req.add_output_filter().

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.3.1
    • core
    • None

    Description

      Add new member function to request object called "add_output_filter()". This would be a wrapper around the function "ap_add_output_filter()" and allow previously defined filters to be attached to the current request such that output can be filtered through them. For example:

      req.add_output_filter("INCLUDES")

      It would probably be necessary for any such call to be done prior to the first output being generated from the request handler.

      In addition to this member function, it may be necessary to also provide another member function called something like "req.add_python_output_filter()". This would be called something like:

      req.add_python_output_filter("module_name::filter_name",path)

      Ie., like "req.add_handler()" but no first argument for phase.

      This method would allow a specific Python filter handler function to be specified. This would be equivalent to using the PythonOutputFilter directive to first name a mod_python based filter handler function and then adding it as an output filter.

      1. Main Apache config.

      PythonOutputFilter module_name::filter_name MYFILTER

      1. Handler code.

      req.add_output_filter("MYFILTER")

      Note that the PythonOutputFilter directive can only be used in the main Apache configuration file, it cannot be used in a .htaccess file. Whether it could be made to work in a .htaccess file in some way needs to be investigated. In mod_perl their equivlent seems to allow it.

      Attachments

        1. grahamd_20060108_1_requestobject.c.diff
          1 kB
          Graham Phillip Dumpleton
        2. grahamd_20060108_2_multiple.diff
          11 kB
          Graham Phillip Dumpleton

        Activity

          People

            grahamd Graham Phillip Dumpleton
            grahamd Graham Phillip Dumpleton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: