-
Bug
-
Resolution: Done
-
Major
-
4.0.0.Final, 4.1.0.Final
-
Low
This is the test case that fails:
PUT uri1
GET uri1
dateLast = Last-Modified header from last GET response
GET uri1 (with header If-Unmodified-Since: dateLast)
should get normal entity response, getting code 412(Precondition Failed) instead
(the 412 should be returned when the date in If-Unmodified-Since is sooner than the stored value but not equal)
The infinispan REST server uses org.jboss.resteasy.specimpl.RequestImpl to decide the preconditions
the issue concerns the date comparation on line 156: if (date.getTime() >= lastModified.getTime())
date - date that was obtained from the request header If-Unmodified-Since
lastModified - the lastmodified date that was stored in MIMECacheEntry
the thing is that lastModified contains also milliseconds whereas date doesn't, it has them zeroed, because it's been just parsed from string.
lastModified contains the milliseconds because the way it's created in MIMECacheEntry constructor during PUT request ( System.currentTimeMillis() )
The milliseconds from the lastModified in MIMECacheEntry should be discarded before the comparation.
- relates to
-
ISPN-858 MIMECacheEntry requires a version
- Closed