/* Since the HTTP time format is (reasonably enough) precise
* only to seconds, any extra milliseconds must be trimmed
* off, or the mtime will almost certainly not match. */
- Date mdate = new Date((mtime / 1000) * 1000);
+ final Date mdate = new Date((mtime / 1000) * 1000);
String ims = req.inheaders().get("If-Modified-Since");
if(ims != null) {
Date cldate;
throw(Restarts.stdresponse(400, "The If-Modified-Since header is not parseable."));
}
if(mdate.compareTo(cldate) <= 0) {
- req.status(304);
- req.outheaders().put("Content-Length", "0");
- throw(Restarts.done());
+ throw(new RequestRestart() {
+ public void respond(Request req) {
+ req.status(304);
+ req.outheaders().put("Content-Length", "0");
+ req.outheaders().put("Last-Modified", Http.fmtdate(mdate));
+ }
+ });
}
}
req.outheaders().put("Last-Modified", Http.fmtdate(mdate));