Skip to content

Commit a59102b

Browse files
authored
Fix createURI for servers without a context path (#43)
1 parent a2d148d commit a59102b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

labkey-client-api/src/org/labkey/remoteapi/Command.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,9 @@ private URI createURI(Connection connection, String folderPath) throws URISyntax
480480
if (null != folderPath && folderPath.length() > 0)
481481
{
482482
String folderPathNormalized = folderPath.replace('\\', '/');
483-
if (folderPathNormalized.charAt(0) != '/' && path.charAt(path.length() - 1) != '/')
483+
if (folderPathNormalized.charAt(0) == '/') // strip leading slash
484+
folderPathNormalized = folderPathNormalized.substring(1);
485+
if (path.charAt(path.length() - 1) != '/')
484486
path.append('/');
485487
path.append(folderPathNormalized);
486488
}

0 commit comments

Comments
 (0)