diff options
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java index 1462593858..d1bd9024e9 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java @@ -122,12 +122,12 @@ public class RepositoryFilter implements Filter { final HttpServletRequest req = (HttpServletRequest) request; String name = req.getPathInfo(); + while (name != null && 0 < name.length() && name.charAt(0) == '/') + name = name.substring(1); if (name == null || name.length() == 0) { ((HttpServletResponse) rsp).sendError(SC_NOT_FOUND); return; } - if (name.startsWith("/")) - name = name.substring(1); final Repository db; try { |