Page 1 of 1

mod_sed use with both in/out filtering

PostPosted: 23. June 2016 12:45
by henzen
Greets,

I'm trying to use mod_sed with both input and output filters at the same time. I can only get the output filter on it's own to work:

<Location "/var/www">
AddOutputFilter Sed html css js pl cgi text
OutputSed "s/123/abc/g"
OutputSed "s/stuff/ffuts/g"
</Location>

I'd like to use an input filter too on the same site:

<Location "/var/www">
AddInputFilter Sed html css js pl cgi text
InputSed "s/abc/123/g"
InputSed "s/ffuts/stuff/g"
</Location>

...but only the output filter is being used. In fact, if I switch on AddInputFilter while the AddOutputFilter is active, then neither work.

I'd appreciate any pointers in getting this to work.

Thanks
Henry

Re: mod_sed use with both in/out filtering

PostPosted: 25. June 2016 13:57
by Nobbie
How do you test your filters?

According to the Apache Documentation, InputSed usually works on POST data. There is no example for any other kind of input (a requested HTML file or a PHP script for example). It is running on stdin, which is assigned to POST data on runtime. So how works your personal test?