James Moger
2014-09-04 e46ddb3c20366d4d68409739e32717ab0d036aa4
src/main/java/com/gitblit/servlet/RawServlet.java
@@ -95,20 +95,17 @@
         baseURL = baseURL.substring(0, baseURL.length() - 1);
      }
      char fsc = '!';
      char c = GitblitContext.getManager(IRuntimeManager.class).getSettings().getChar(Keys.web.forwardSlashCharacter, '/');
      if (c != '/') {
         fsc = c;
      }
      if (branch != null) {
         char fsc = '!';
         char c = GitblitContext.getManager(IRuntimeManager.class).getSettings().getChar(Keys.web.forwardSlashCharacter, '/');
         if (c != '/') {
            fsc = c;
         }
         branch = branch.replace('/', fsc);
      }
      String encodedPath = path == null ? "" : path.replace(' ', '-');
      try {
         encodedPath = URLEncoder.encode(encodedPath, "UTF-8");
      } catch (UnsupportedEncodingException e) {
      }
      encodedPath = encodedPath.replace('/', fsc);
      return baseURL + Constants.RAW_PATH + repository + "/" + (branch == null ? "" : (branch + "/" + (path == null ? "" : encodedPath)));
   }
@@ -133,7 +130,8 @@
      if (path.endsWith("/")) {
         path = path.substring(0, path.length() - 1);
      }
      return path;
      char c = runtimeManager.getSettings().getChar(Keys.web.forwardSlashCharacter, '/');
      return path.replace('!', '/').replace(c, '/');
   }
   protected boolean renderIndex() {
@@ -175,6 +173,9 @@
            repository = path.substring(0, slash);
         }
         offset += slash;
         if (offset == 0) {
            offset++;
         }
         r = repositoryManager.getRepository(repository, false);
         if (repository.equals(path)) {
            // either only repository in url or no repository found