users@jersey.java.net

Re: [Jersey] 304 Not Modified does not send back Last-Modified

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 20 Feb 2009 09:31:39 +0100

Hi Bill,


On Feb 19, 2009, at 10:51 PM, Bill de hOra wrote:

> In jersey 1.0.1 the ResponseBuilder created to send back 304 sends
> back the Etag header and not Last-Modified - is that intentional or
> will I send in a patch?
>

Please, that would be most helpful.

I just verified that there is an issue. Annoying in the unit tests i
forgot to assert that the etag and data should be present:

     public void
testIfNonMatchWithMatchingETag_IfModifiedSinceAfterLastModified() {
         initiateWebApplication(LastModifiedEtagResource.class);
         ClientResponse response = resource("/", false).
                 header("If-None-Match", "\"1\"").
                 header("If-Modified-Since", "Tue, 2 Jan 2007 00:00:00
GMT").
                 get(ClientResponse.class);
         assertEquals(304, response.getStatus());
     }

Paul.