Author: [email protected]
Date: Tue Oct 25 15:09:49 2011
New Revision: 1590

Log:
AMDATU-458 fixed (milli)second resolution

Modified:
   
trunk/amdatu-web/resource/src/main/java/org/amdatu/web/resource/service/ResourceServlet.java

Modified: 
trunk/amdatu-web/resource/src/main/java/org/amdatu/web/resource/service/ResourceServlet.java
==============================================================================
--- 
trunk/amdatu-web/resource/src/main/java/org/amdatu/web/resource/service/ResourceServlet.java
        (original)
+++ 
trunk/amdatu-web/resource/src/main/java/org/amdatu/web/resource/service/ResourceServlet.java
        Tue Oct 25 15:09:49 2011
@@ -47,10 +47,14 @@
             InputStream is = null;
             try {
                 conn = url.openConnection();
-                long lastModified = conn.getLastModified();
+
+                // convert millisecond precision of getLastModified() to 
second precision used 
+                // in HTTP headers before comparing
+                long lastModified = (conn.getLastModified() / 1000) * 1000;
                 if (lastModified != 0) {
                     response.setDateHeader("Last-Modified", lastModified);
                 }
+
                 // send the whole response, unless there was an "if modified 
since" header and the
                 // resource is indeed not modified since that date
                 long ifModifiedSince = 
request.getDateHeader("If-Modified-Since");
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits

Reply via email to