Jeffrey E Rodriguez created KNOX-578:
-----------------------------------------
Summary: Supporting Regex patterns on rewrite patters accross Html
Filtering beyon embeded JS
Key: KNOX-578
URL: https://issues.apache.org/jira/browse/KNOX-578
Project: Apache Knox
Issue Type: Improvement
Components: Server
Affects Versions: 0.7.0
Environment: All
Reporter: Jeffrey E Rodriguez
Fix For: 0.7.0
The reason for the this is that we already have some Regex support
on embedded Javascript but it doesn't seem to work on some other cases like in
Html elements like.
meta element which is used by Yarn UI for example where some
of the UI pages uses them to do a meta refresh.
e.g.
Let say we want the following outbound html content to go through Knox
<meta http-equiv="refresh" content="0; url=http://service">
So we would like to rewrite it to:
<meta http-equiv="refresh" content="0;
url=http://knox_host:knox_port/gateway/default/service">
I can match the entire "0; url=http://service" with a rule dir="OUT"
but I don't have control on how to parse the refresh time from the url so if
the page changes tomorrow I respect it in the rewrite.
If Regex would be supported then we could use something like (\d);\s*(.*) to
capture the refresh time in the rule and use
it in the rewrite template.
The case above is a simple one, but having better control through Regex on how
to parse patterns and use matched groups would be desirable.
Kevin Minder, said the following:
"Something like
<apply-regex path=“{xpath}” regex=“{regex}” rule=“{rule}”/>
Where the rule would be applied to say group(1) of the regex. Might even be
able to build that into the normal <apply/> with an implied regex=“.*”.
"
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)