You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Robin Coe <rc...@gmail.com> on 2013/07/10 17:48:33 UTC

[users@httpd] incomplete mod_filter substitution results

I have been attempting to use mod_filter with mod_substitute to modify
the response stream and change the back-end server host name and
protocol in content being returned to users beyond the firewall.  The
proxy server is fronting Windchill PLM software, which uses an apache
proxy in front of tomcat.  The rules I am using correctly replace most
occurrences but fails consistently for certain link references.  It
looks like the problem links have anchor tags with special characters.
 What *should* happen is that all host references should be changed
from http to https and the server name changed from mike to lima.

#ORIGINAL RESPONSE
<div class="x-tree-node-el x-tree-node-leaf x-unselectable file"
unselectable="on"
ext:tree-node-id="recentContexts_~_OR:wt.inf.library.WTLibrary:207909254_~_listFiles|library">
<span class="x-tree-node-indent">
<img class="x-tree-ec-icon x-tree-elbow"
src="http://mike.***.***.ca/Windchill/netmarkets/images/sp.gif">
<img class="x-tree-node-icon x-tree-node-inline-icon"
unselectable="on"
src="http://mike.***.***.ca/Windchill/netmarkets/images/default_leaf.png">
<a class="x-tree-node-anchor" tabindex="1"
href="http://mike.***.***.ca/Windchill/app/#ptc1/library/listFiles?oid=OR%3Awt.inf.library.WTLibrary%3A207909254&u8=1"
hidefocus="on">
</div>

#PROCESSED RESPONSE
<div class="x-tree-node-el x-tree-node-leaf x-unselectable file"
unselectable="on"
ext:tree-node-id="recentContexts_~_OR:wt.inf.library.WTLibrary:207909254_~_listFiles|library">
<span class="x-tree-node-indent">
<img class="x-tree-ec-icon x-tree-elbow"
src="https://lima.***.***.ca/Windchill/netmarkets/images/sp.gif">
<img class="x-tree-node-icon x-tree-node-inline-icon"
unselectable="on"
src="https://lima.***.***.ca/Windchill/netmarkets/images/default_leaf.png">
<a class="x-tree-node-anchor" tabindex="1"
href="http://mike.***.***.ca/Windchill/app/#ptc1/library/listFiles?oid=OR%3Awt.inf.library.WTLibrary%3A207909254&u8=1"
hidefocus="on">
</div>

Notice the last link in the processed content was left untouched.

The rule to replace content looks like:

RequestHeader unset Accept-Encoding
FilterDeclare wcproxy
FilterProvider wcproxy SUBSTITUTE Content-Type /text|json/
FilterChain +
FilterTrace wcproxy 1
Substitute "s|(http)://mike(.*)|$1s://lima$2|i"

So, is this a known limitation in mod_filter or a bug that I should report?

PLATFORM DETAILS:

System details:
Red Hat Enterprise Linux Server release 6.3 (Santiago)
Linux lima.***.***.ca 2.6.32-279.5.2.el6.x86_64 #1 SMP Tue Aug 14
11:36:39 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

CentOS release 6.4 (Final)
Linux centosvm 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed Jun 12 03:34:52
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Apache versions:
Server version: Apache/2.2.25 (Unix)
Server built:   Jul  8 2013 12:46:53

Server version: Apache/2.2.15 (Unix)
Server built:   Apr 29 2013 04:13:12

Loaded Modules:
 core_module (static)
 authn_file_module (static)
 authn_default_module (static)
 authz_host_module (static)
 authz_groupfile_module (static)
 authz_user_module (static)
 authz_default_module (static)
 auth_basic_module (static)
 include_module (static)
 filter_module (static)
 log_config_module (static)
 env_module (static)
 setenvif_module (static)
 version_module (static)
 mpm_prefork_module (static)
 http_module (static)
 mime_module (static)
 status_module (static)
 autoindex_module (static)
 asis_module (static)
 cgi_module (static)
 negotiation_module (static)
 dir_module (static)
 actions_module (static)
 userdir_module (static)
 alias_module (static)
 so_module (static)
 substitute_module (shared)
 proxy_module (shared)
 proxy_http_module (shared)
 ssl_module (shared)
 headers_module (shared)
Syntax OK


Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org