in src/main/java/com/googlesource/gerrit/plugins/imagare/ImageServlet.java [230:249]
private void send(
HttpServletRequest req,
HttpServletResponse res,
byte[] content,
String contentType,
long lastModified)
throws IOException {
if (0 < lastModified) {
long ifModifiedSince = req.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
if (ifModifiedSince > 0 && ifModifiedSince == lastModified) {
res.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
return;
}
res.setDateHeader("Last-Modified", lastModified);
}
res.setContentType(contentType);
res.setCharacterEncoding(UTF_8.name());
res.setContentLength(content.length);
res.getOutputStream().write(content);
}