James Moger
2014-09-04 a4fa1b996be8641aa5c89375ee78cc6eb70a7c76
src/main/java/com/gitblit/servlet/RawServlet.java
@@ -106,10 +106,6 @@
      String encodedPath = path == null ? "" : path.replace(' ', '-');
      encodedPath = encodedPath.replace('/', fsc);
      try {
         encodedPath = URLEncoder.encode(encodedPath, "UTF-8");
      } catch (UnsupportedEncodingException e) {
      }
      return baseURL + Constants.RAW_PATH + repository + "/" + (branch == null ? "" : (branch + "/" + (path == null ? "" : encodedPath)));
   }
@@ -134,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() {
@@ -424,11 +421,8 @@
      }
   }
   private void streamFromRepo(HttpServletResponse response, Repository repository,
   protected void streamFromRepo(HttpServletResponse response, Repository repository,
         RevCommit commit, String requestedPath) throws IOException {
      response.setDateHeader("Last-Modified", JGitUtils.getCommitDate(commit).getTime());
      response.setHeader("Cache-Control", "public, max-age=3600, must-revalidate");
      RevWalk rw = new RevWalk(repository);
      TreeWalk tw = new TreeWalk(repository);
@@ -460,9 +454,8 @@
      response.flushBuffer();
   }
   private void sendContent(HttpServletResponse response, Date date, InputStream is) throws ServletException, IOException {
      response.setDateHeader("Last-Modified", date.getTime());
      response.setHeader("Cache-Control", "public, max-age=3600, must-revalidate");
   protected void sendContent(HttpServletResponse response, Date date, InputStream is) throws ServletException, IOException {
      try {
         byte[] tmp = new byte[8192];
         int len = 0;