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

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

Commit 4eeff1a6d156db860245916fa44e2a1505247e43 in knox's branch 
refs/heads/master from [~lmccay]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=4eeff1a ]

Revert "KNOX-690 fixing the encoding/decoding in the parser and template"

This reverts commit 994836cb656252128d26117d95320f69a35779d5.


> URL Template matching not properly handling encoded URLs
> --------------------------------------------------------
>
>                 Key: KNOX-690
>                 URL: https://issues.apache.org/jira/browse/KNOX-690
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 0.9.0
>            Reporter: Kevin Minder
>            Assignee: Sumit Gupta
>             Fix For: 0.9.0
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
>     Template template;
>     Template input;
>     Matcher<String> matcher;
>     Matcher<?>.Match match;
>     matcher = new Matcher<String>();
>     template = Parser.parseTemplate( "*://*:*/example" );
>     matcher.add( template, "test-example" );
>     template = Parser.parseTemplate( "*://*:*/|" );
>     matcher.add( template, "test-pipe-in-path" );
>     template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
>     matcher.add( template, "test-pipe-in-query-param-name" );
>     template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
>     matcher.add( template, "test-pipe-in-query-param-value" );
>     template = Parser.parseTemplate( "*://*:*/path#|" );
>     matcher.add( template, "test-pipe-in-fragment" );
>     input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
>     match = matcher.match( input );
>     assertThat( match, notNullValue() );
>     assertThat( (String)match.getValue(), is( "test-example" ) );
>     input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
>     match = matcher.match( input );
>     assertThat( match, notNullValue() );
>     assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
>     input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
>     match = matcher.match( input );
>     assertThat( match, notNullValue() );
>     assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
>     input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
>     match = matcher.match( input );
>     assertThat( match, notNullValue() );
>     assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
>     input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
>     match = matcher.match( input );
>     assertThat( match, notNullValue() );
>     assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to