Set Last-Modified on MarkDown->HTML plugin pages
When a Plugin MarkDown file is served and transparently converted into an HTML page, the HTTP Last-Modified field was set on the cached resource but *NOT* on the returned HTTP response. This was causing a second HTTP 200 even if the resource was actually not modified from the first request. With this fix, the second response to the browser will be an HTTP 304 (not modified) as it should be. Change-Id: I9304bde5f9633b2b2f965e9d632303fd022d6651
This commit is contained in:
@@ -452,6 +452,7 @@ class HttpPluginServlet extends HttpServlet
|
||||
res.setContentType("text/html");
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
res.setContentLength(html.length);
|
||||
res.setDateHeader("Last-Modified", lastModifiedTime);
|
||||
res.getOutputStream().write(html);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user