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

ASF subversion and git services commented on KNOX-614:
------------------------------------------------------

Commit 999831779eeb2dbaffc2e655ac1727382dc93afa in knox's branch 
refs/heads/master from [~kevin.minder]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=9998317 ]

KNOX-614: Incorrect URI template expansion with {**} query params #fragments


> Incorrect URI template expansion with {**} query params #fragments 
> -------------------------------------------------------------------
>
>                 Key: KNOX-614
>                 URL: https://issues.apache.org/jira/browse/KNOX-614
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 0.6.0
>            Reporter: Christopher Jackson
>            Assignee: Kevin Minder
>             Fix For: 0.7.0
>
>
> The following test case does not produce the expected output. 
> {code}
> java.lang.AssertionError: 
> Expected: is 
> "https://gateway-host:9443/gateway/default/foo/context/?user.name=admin#/login";
> got: 
> "https://gateway-host:9443/gateway/default/foo/context/?fragment=/login#/login";
> {code}
> {code}
> @Test
>       public void testRedirectHeaderRewrite() throws Exception {
>               URI inputUri, outputUri;
>               Matcher<Void> matcher;
>               Matcher<Void>.Match match;
>               Template input, pattern, template;
>               Evaluator evaluator;
>               inputUri = new 
> URI("https://internal-host:9443/context/?user.name=admin#/login";);
>               input = Parser.parse( inputUri.toString() );
>               pattern = Parser.parse( 
> "*://*:*/{contextRoot}/?{**}#{fragment}" );
>               template = Parser.parse( 
> "{$gateway.url}/foo/{contextRoot}/?{**}#{fragment}" );
>               matcher = new Matcher<Void>();
>               matcher.add( pattern, null );
>               match = matcher.match( input );
>               evaluator = new Evaluator() {
>                   @Override
>                   public List<String> evaluate( String function, List<String> 
> parameters ) {
>                     return Arrays.asList( 
> "https://gateway-host:9443/gateway/default"; );
>                   }
>                 };
>               
>               outputUri = Expander.expand( template, match.getParams(), 
> evaluator );
>               assertNotNull(outputUri.toString());
>               assertThat(
>                               outputUri.toString(),
>                               is( 
> "https://gateway-host:9443/gateway/default/foo/context/?user.name=admin#/login";
>  ) );
>       }
> {code}



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

Reply via email to