fix double / in url

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1177075 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-09-28 21:38:13 +00:00
parent e442d48741
commit e259d38caf
1 changed files with 6 additions and 2 deletions

View File

@ -251,13 +251,17 @@ public class DefaultSearchService
{
return null;
}
if (StringUtils.isEmpty( artifact.getUrl() ))
if ( StringUtils.isEmpty( artifact.getUrl() ) )
{
return null;
}
StringBuilder sb = new StringBuilder( getBaseUrl( httpContext.getHttpServletRequest() ) );
sb.append( "/repository/" );
sb.append( "/repository" );
if ( !StringUtils.startsWith( artifact.getUrl(), "/" ) )
{
sb.append( '/' );
}
sb.append( artifact.getUrl() );
return sb.toString();
}