httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Strick <douglas.str...@gmail.com>
Subject [users@httpd] Re: Conditional response body modification
Date Fri, 25 Apr 2014 21:02:22 GMT
I wasn't able to come up with anything further on the mod_ext_filter
solution.  I did come across mod_parp <http://parp.sourceforge.net> (
http://parp.sourceforge.net).  It says it's able to parse the request data
and make it available to other apache modules.  I've gotten it compiled and
enabled on my apache, but I'm not sure I'm understanding how to pull the
data into mod_substitute.  Anyone have any ideas how I can make the
HTTP_COOKIE data available to mod_substitute?  Let me know if I'm
completely off base here in understanding what this module can do as well.
 Thanks


        <IfModule mod_parp.c>
          SetEnvIf      HTTP_COOKIE     "(^|)CUST_TYPE=test"   parp
        </IfModule>



On Thu, Apr 17, 2014 at 3:01 PM, Doug Strick <douglas.strick@gmail.com>wrote:

> I've come up with the below config using mod_ext_filter which isn't
> desirable, but it's the only thing I've been able to come up with so far.
>  It's not working exactly yet.  Any suggestions?
>
>
> SetEnvIf HTTP_COOKIE "USER_TYPE=test" FILTER=$1
>
>
> *Inside VirtualHost:*
>
> ExtFilterDefine doug mode=output intype=text/html enableenv=FILTER \
>
> cmd="/bin/bash /apps/httpd/scripts/replace.sh"
>
>
>
> <Location />
>
>   SetOutputFilter doug
>
> </Location>
>
>
>
> *replace.sh*
>
> #!/bin/bash
>
>
> /bin/sed -r 's/http\:\/\//https\:\/\//g'
>
>
> On Wed, Apr 16, 2014 at 10:23 AM, Doug Strick <douglas.strick@gmail.com>wrote:
>
>> Hello,
>>
>> I'm looking for a way to modify the data on outgoing requests
>> conditionally.  I've tried using mod_substitute, but that appears to be an
>> all or nothing module.  The documentation for mod_filter says it can be
>> invoked on environment variables, but it's not exactly clear on the valid
>> syntax for those variables.  Basically, I'm looking for a way to change all
>> links from HTTP to HTTPS in my outgoing responses for users with a specific
>> cookie.  Any suggestions?  Thanks
>>
>
>

Mime
View raw message