Re: [users@httpd] SetOutputFilter doesn't work in <Location>s?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Axel-Stéphane SMORGRAV wrote:
SetOutputFilter works very well, even in Location filters. There are lots of happy customers of this feature, using it for such things as for example compression of response bodies.

Are you quite sure your filter is NOT invoked? Could you possibly have it generate some output to stderr?

I copied your filter declarations into an Apache 2.0.54 configuration and was unable to reproduce the behaviour you describe. That said, the response was cached by the browser and when reloading the page, it issued a conditional request to which the server responded with a 304. Therefore, at first it appeared as if the filter was not invoked, but after forcing an unconditional request, the page was correctly updated.

Here are the relevant parts of the configuration I used:

LoadModule ext_filter_module /opt/apache2/modules/mod_ext_filter.so
Listen labelle16:80

NameVirtualHost *:80
<VirtualHost *:80>
   ServerName labelle16.gsi.fr
   DocumentRoot /www/apachetest/htdocs/labelle16
   CustomLog /www/apachetest/logs/access16_log combined
   ErrorLog  /www/apachetest/logs/error16_log
   LogLevel debug

   ExtFilterDefine a mode=output intype=text/html outtype=text/html cmd="/bin/sed -e s/foo/bar/g"
   ExtFilterDefine b mode=output intype=text/html outtype=text/html cmd="/bin/sed -e s/bing/boom/g"

   <Location /test>
       Header set Cache-Control no-cache
       SetOutputFilter a
   </Location>
</VirtualHost>

Thanks for the response, and apologies for the delay in replying: I've been away for the last week or so.

I tried with a configuration similar to yours and, yes, it works! The Header module is a new one for me: nice to know. A bit of investigation seems to reveal that adding another Location with a MultiViews DirectoryIndex can stop the filter from working:

<Location />
    Options +MultiViews
    DirectoryIndex index
</Location>

Just adding "Options +MultiViews" or using e.g. "DirectoryIndex index.html" doesn't affect the filters. Any suggestions as to what's going on here? Is this a bug or an expected behaviour/side-effect of how content negotiation works?

Thanks again,
Andy

--
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux