diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-04 13:04:20 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-04 13:04:20 -0400 |
commit | 818973b2baece0ff3245de10091f5ca8bdffebc6 (patch) | |
tree | 66fe9009efc25bb085170c05e0de50ff14508b73 /src/main/java/com/gitblit/servlet/RawServlet.java | |
parent | 16e1542465bf7dfd89c02299d9bd47a3be15209e (diff) | |
download | gitblit-818973b2baece0ff3245de10091f5ca8bdffebc6.tar.gz gitblit-818973b2baece0ff3245de10091f5ca8bdffebc6.zip |
Do not stamp raw servlet responses with cache-control headers
Diffstat (limited to 'src/main/java/com/gitblit/servlet/RawServlet.java')
-rw-r--r-- | src/main/java/com/gitblit/servlet/RawServlet.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/servlet/RawServlet.java b/src/main/java/com/gitblit/servlet/RawServlet.java index a9e58202..30d33fd7 100644 --- a/src/main/java/com/gitblit/servlet/RawServlet.java +++ b/src/main/java/com/gitblit/servlet/RawServlet.java @@ -421,12 +421,9 @@ public class RawServlet extends DaggerServlet { } } - 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); try { @@ -457,9 +454,8 @@ public class RawServlet extends DaggerServlet { 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; |