[ 
https://issues.apache.org/jira/browse/KNOX-381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Minder updated KNOX-381:
------------------------------

    Description: 
The problem is that this template
{code}
{host}:{port}
{code}
we expanded to this
{code}
///test-host:777
{code}
The goal of the URL Template/Rewriter/Expander is to produce an output that is 
exactly like the input even if they syntax isn't strictly correct for URLs.

{code}
  @Test
  public void testHostAndPortOnlyExpansionBugKnox381() throws Exception {
    String text = "{host}:{port}";
    Template template = Parser.parse( text );
    MockParams params = new MockParams();
    params.addValue( "host", "test-host" );
    params.addValue( "port", "777" );
    URI expanded = Expander.expand( template, params, null );
    assertThat( expanded.toString(), equalTo( "test-host:777" ) ) ;
  }
{code}

  was:
The problem is that this template
{host}:{port}
we expanded to this
///test-host:777
The goal of the URL Template/Rewriter/Expander is to produce an output that is 
exactly like the input even if they syntax isn't strictly correct for URLs.

{code}
  @Test
  public void testHostAndPortOnlyExpansionBugKnox381() throws Exception {
    String text = "{host}:{port}";
    Template template = Parser.parse( text );
    MockParams params = new MockParams();
    params.addValue( "host", "test-host" );
    params.addValue( "port", "777" );
    URI expanded = Expander.expand( template, params, null );
    assertThat( expanded.toString(), equalTo( "test-host:777" ) ) ;
  }
{code}


> Expansion of authority only URL should not be prefixed with //
> --------------------------------------------------------------
>
>                 Key: KNOX-381
>                 URL: https://issues.apache.org/jira/browse/KNOX-381
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 0.4.0
>            Reporter: Kevin Minder
>            Assignee: Kevin Minder
>             Fix For: 0.5.0
>
>
> The problem is that this template
> {code}
> {host}:{port}
> {code}
> we expanded to this
> {code}
> ///test-host:777
> {code}
> The goal of the URL Template/Rewriter/Expander is to produce an output that 
> is exactly like the input even if they syntax isn't strictly correct for URLs.
> {code}
>   @Test
>   public void testHostAndPortOnlyExpansionBugKnox381() throws Exception {
>     String text = "{host}:{port}";
>     Template template = Parser.parse( text );
>     MockParams params = new MockParams();
>     params.addValue( "host", "test-host" );
>     params.addValue( "port", "777" );
>     URI expanded = Expander.expand( template, params, null );
>     assertThat( expanded.toString(), equalTo( "test-host:777" ) ) ;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to