James Moger
2012-07-10 2ec0d7fcf3017c3b8f825bd6d1e82da0966b24ca
src/com/gitblit/PagesServlet.java
@@ -141,13 +141,15 @@
         }
         response.setDateHeader("Last-Modified", JGitUtils.getCommitDate(commit).getTime());
         String [] encodings = GitBlit.getEncodings();
         RevTree tree = commit.getTree();
         byte[] content = null;
         if (StringUtils.isEmpty(resource)) {
            // find resource
            String[] files = { "index.html", "index.htm", "index.mkd" };
            for (String file : files) {
               content = JGitUtils.getStringContent(r, tree, file)
               content = JGitUtils.getStringContent(r, tree, file, encodings)
                     .getBytes(Constants.ENCODING);
               if (content != null) {
                  resource = file;
@@ -165,7 +167,7 @@
                  contentType = "text/plain";
               }
               if (contentType.startsWith("text")) {
                  content = JGitUtils.getStringContent(r, tree, resource).getBytes(
                  content = JGitUtils.getStringContent(r, tree, resource, encodings).getBytes(
                        Constants.ENCODING);
               } else {
                  content = JGitUtils.getByteContent(r, tree, resource);
@@ -177,7 +179,7 @@
         // no content, try custom 404 page
         if (ArrayUtils.isEmpty(content)) {
            String custom404 = JGitUtils.getStringContent(r, tree, "404.html");
            String custom404 = JGitUtils.getStringContent(r, tree, "404.html", encodings);
            if (!StringUtils.isEmpty(custom404)) {
               content = custom404.getBytes(Constants.ENCODING);
            }