You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Kevin Minder (JIRA)" <ji...@apache.org> on 2016/04/04 17:25:25 UTC

[jira] [Commented] (KNOX-618) Rewrite function for accessing header values

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

Kevin Minder commented on KNOX-618:
-----------------------------------

[~jeffreyr97@gmail.com] < You should probably do a bit more research about what the HOST header can contain.  In particular note that sometimes it contains just the hostname and sometimes it contains the host:port combination depending upon if the default port for a given scheme is used.  A fact I find particularly frustrating BTW.  In this instance I'm still missing why $frontend[port] isn't what you are after?  Or are you really after a new function like $servicePort[NMUI]?

We should talk through the multiple URLs issue possibly in a new jira.  This intersects in strange ways with HA so we would need to really think through how it needs to be used vs how HA is used.

> Rewrite function for accessing header values
> --------------------------------------------
>
>                 Key: KNOX-618
>                 URL: https://issues.apache.org/jira/browse/KNOX-618
>             Project: Apache Knox
>          Issue Type: New Feature
>          Components: Server
>    Affects Versions: 0.6.0
>            Reporter: Kevin Minder
>            Assignee: Kevin Minder
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: KNOX-618_001.patch
>
>
> I recently ran into a situation where it would have been useful to have access to header values in the rewrite rules.  In particular it would be useful sometimes to API version with a header like this.
> {code}
>     <match pattern="{scheme}://{host}:{port}/api/{path=**}?{**}">
>         <rewrite template=""{scheme}://{host}:{port}/api/{$header[version]}/{path}?{**}""/>
>     </match>
> {code}
> As implied above the rewrite function plugin model seems like an excellent way to provide basic access to header information.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)