Login 
 
 Pref   Your subscriptions   Home   Help 
dev@ml.mod-xslt2.com
mod-xslt2 - Development Mailing List
   
 
List info
 
 
 
Subscribe
 
 
Unsubscribe
 
 
Archive
 
 
Post
 



Advanced search
2004 01 02 03 04 05 06 07 08 09 10 11 12
2005 01 02 03 04 05 06 07 08 09 10 11 12
2006 01 02 03 04 05 06 07 08 09 10 11 12
2007 01 02 03 04 05 06 07 08 09 10 11 12
2008 01 02 03 04 05 06 07 08 09 10 11 12

  previous   Chronological   next       previous   Thread   next  

Re: [mod-xslt dev] patch: add environment variable override Colin Bendell
  • From: "Colin Bendell" <colin@xxxxxxxxxx>
  • To: dev@xxxxxxxxxxxxxxxx
  • Subject: Re: [mod-xslt dev] patch: add environment variable override
  • Date: Mon, 29 Jan 2007 13:41:38 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=PkDxzeMssrZhy/ngcYg+ocB6T8tyIxeq9uw/PYG0BT1Bh3IQtfFwdrDuYpeBqNwM8t61NnsKv6G6WjNsWkbWL2m0hvpD3TFGBHhCkcuvBnYwVQ+2siAyaOrtF+cmOYp+gjrqZEloD61J/nzEWUiV0UNv14/yhbpzzTTg+Q9XEkQ=
  • References: <sympa.1170099379.25483.536@ml.mod-xslt2.com>


  • sorry for the dup post - the forum was throwing crazy errors about not
    authorized to do the action.

    On 1/29/07, colin@xxxxxxxxxx <colin@xxxxxxxxxx> wrote:
    The patch below adds SetEnvIf environment variable support that can be used to disable mod_xslt. Effectively, this can be used to mimics the functionality of XSLTAddRule but can also be used for dynamically assigned xslt. With this patch you can AddOutputFilter and then disable it based on any criteria necessary. This allows for more customized control over the execution of the mod_xslt module.

    For example:
    <Location ~ "\.php|/$|^[^.]*$">
    SetOutputFilter mod-xslt
    </Location>
    SetEnvIf Request_URI /Rss.php no-xslt

    This will enable the OutputFilter for all .php files (incl welcome pages) but disable it for the rss.php. While this is a primitive example, my scenario required adjustment based on Headers and parameters which is much more complicated for <Location> matches.

    Also this patch also moves the removal of the Content-Length to after the quick exit block. This is important so that pipelining is preserved even if the mod_xslt is dynamically removed from the chain.

    --- modxslt-2005072700/sapi/apache2/modxslt.c.orig 2005-07-27
    04:27:57.000000000 -0600
    +++ modxslt-2005072700/sapi/apache2/modxslt.c 2007-01-24
    15:03:35.000000000 -0600
    @@ -138,7 +138,8 @@
    const char * forcestyle, * defaultstyle;
    void * get;

    - apr_table_unset(f->r->headers_out, "Content-Length");
    + if (apr_table_get(f->r->subprocess_env, "no-xslt"))
    + return ap_pass_brigade(f->next, brigade);

    if(f->r->header_only)
    return ap_pass_brigade(f->next, brigade);
    @@ -148,6 +149,8 @@
    if(f->r->status != HTTP_OK)
    return ap_pass_brigade(f->next, brigade);

    + apr_table_unset(f->r->headers_out, "Content-Length");
    +
    data=(apr_bucket_brigade *)f->ctx;
    ap_save_brigade(f, &data, &brigade, f->r->pool);
    f->ctx=data;


      Powered by Sympa