Using mod_lua as OutputFilter and status != 200

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

 




Hi,

using mod_lua (httpd: 2.4.34) for rewriting my outgoing content by

LuaOutputFilter MyOutputFilter "/my/lib/lua/output-filter.lua" output_filter
SetOutputFilter MyOutputFilter

works great when the webserver returns content with status 200.
Sadly the output_filter-function is not getting called when httpd is redirecting content (301 or 302) or sends a 403.
Is that a bug in httpd/mod_lua or a wrong usage of mine?
The relevant config looks like:

LoadModule lua_module modules/mod_lua.so
LuaOutputFilter MyOutputFilter "/my/lib/lua/output-filter.lua" output_filter
SetOutputFilter MyOutputFilter
Redirect /test1.html /test1
RewriteEngine On
RewriteRule ^/test2.html$ /test2 [R=301,L]
RewriteRule ^/test3.html$ /test3 [R=302,L]
RewriteRule ^/test4.html$ - [F,L]

in /my/lib/lua/output-filter.lua I have:
function output_filter(r)
   r:err("Got called.")
end

Accesing http://127.0.0.1/test[N].html redirects or returns a 403, but the output_filter-function gets never called. (I also renamed 'output_filter' to 'MyOutputFilter' but that changed nothing.)

If I disable mod_lua, load mod_perl instead, and use PerlOutputFilterHandler for rewriting the output httpd will call that output filter at every status!
Any ideas what's going on here?

Best regards for any hints,
Frank

P.S.: Is there a reason why "AddOutputFilterByType MyOutputFilter text/html" does never work, while e.g. "AddOutputFilterByType DEFLATE text/html" does? Is the filter functionality of mod_lua broken?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-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