Skip to content

Commit

Permalink
round the datastream modified date down to the second to match the HT…
Browse files Browse the repository at this point in the history
…TP header granularity
  • Loading branch information
cbeer committed Mar 12, 2013
1 parent e0ab6ce commit 9c3568b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
Expand Down Expand Up @@ -362,9 +363,9 @@ public Response getDatastreamContent(@PathParam("pid")

EntityTag etag = new EntityTag(ds.getContentDigest().toString());
Date date = ds.getLastModifiedDate();
// ResponseBuilder builder = request.evaluatePreconditions(date, etag);

ResponseBuilder builder = request.evaluatePreconditions(etag);
Date rounded_date = new Date();
rounded_date.setTime(date.getTime() - (date.getTime() % 1000));
ResponseBuilder builder = request.evaluatePreconditions(rounded_date, etag);

CacheControl cc = new CacheControl();
cc.setMaxAge(0);
Expand Down

0 comments on commit 9c3568b

Please sign in to comment.