X-Git-Url: http://dolda2000.com/gitweb/?p=jsvc.git;a=blobdiff_plain;f=src%2Fdolda%2Fjsvc%2Futil%2FStaticContent.java;h=685669c09df6077c9df55a8a91793e15c68e6511;hp=0d4208ef2ac7f01e40722b0ddf8d8a94759cf08d;hb=60ef28853e4aca8b227f533c4b95c03de6574e02;hpb=28aca7f5ccfb69b54ee60e68dbe0a590844b9e97 diff --git a/src/dolda/jsvc/util/StaticContent.java b/src/dolda/jsvc/util/StaticContent.java index 0d4208e..685669c 100644 --- a/src/dolda/jsvc/util/StaticContent.java +++ b/src/dolda/jsvc/util/StaticContent.java @@ -36,25 +36,10 @@ public class StaticContent implements Responder { } if(in == null) throw(Restarts.stdresponse(404)); - String ims = req.inheaders().get("If-Modified-Since"); - Date mtime = new Date((req.ctx().starttime() / 1000) * 1000); - if(ims != null) { - Date d; - try { - d = Http.parsedate(ims); - } catch(java.text.ParseException e) { - throw(Restarts.stdresponse(400)); - } - if(mtime.compareTo(d) <= 0) { - req.status(304); - req.outheaders().put("Content-Length", "0"); - return; - } - } + Cache.checkmtime(req, req.ctx().starttime()); try { try { req.outheaders().put("Content-Type", mimetype); - req.outheaders().put("Last-Modified", Http.fmtdate(mtime)); Misc.cpstream(in, req.output()); } finally { in.close();