[
https://issues.apache.org/jira/browse/KNOX-381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Work on KNOX-381 started by Kevin Minder.
> 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. Below is a test the reproduces the issue.
> {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)