You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Wei Han (JIRA)" <ji...@apache.org> on 2018/07/31 16:30:00 UTC

[jira] [Commented] (KNOX-578) Supporting Regex patterns on rewrite patters accross Html Filtering beyon embeded JS

    [ https://issues.apache.org/jira/browse/KNOX-578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16563932#comment-16563932 ] 

Wei Han commented on KNOX-578:
------------------------------

[~jeffreyr97] [~kminder] Was there a follow up on this JIRA? Looks like I'm facing a similar issue with jobhistory UI, which has the following meta refresh tag:
{quote} <meta http-equiv="refresh" content="1; url=http://hadoopmaster007:19888/jobhistory/logs/hadoopworker3064:8041/container_e50_1529521645530_115338_01_000001/container_e50_1529521645530_115338_01_000001/xxxx">
{quote}

> 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
>            Priority: Major
>             Fix For: Future
>
>
> 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
(v7.6.3#76005)