]> source.dussan.org Git - gitblit.git/commitdiff
Fixed last modified caching for logo servlet
authorJames Moger <james.moger@gitblit.com>
Wed, 26 Jun 2013 21:43:37 +0000 (17:43 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 26 Jun 2013 21:43:37 +0000 (17:43 -0400)
src/main/java/com/gitblit/LogoServlet.java

index 7402fc1324509ae7ac1b871b2727ffaecb429261..166bf40fae6755e7acfcee3104ac8ffec4f5ee4b 100644 (file)
@@ -47,7 +47,7 @@ public class LogoServlet extends HttpServlet {
        protected long getLastModified(HttpServletRequest req) {\r
                File file = GitBlit.getFileOrFolder(Keys.web.headerLogo, "${baseFolder}/logo.png");\r
                if (file.exists()) {\r
-                       return file.lastModified();\r
+                       return Math.max(lastModified, file.lastModified());\r
                } else {\r
                        return lastModified;\r
                }\r
@@ -65,7 +65,7 @@ public class LogoServlet extends HttpServlet {
                                ServletContext context = request.getSession().getServletContext();\r
                                contentType = context.getMimeType(file.getName());\r
                                response.setContentLength((int) file.length());\r
-                               response.setDateHeader("Last-Modified", file.lastModified());\r
+                               response.setDateHeader("Last-Modified", Math.max(lastModified, file.lastModified()));\r
                                is = new FileInputStream(file);\r
                        } else {\r
                                // default logo\r