On 11/29/10 8:38 PM, Konstantin Preißer wrote: >> At the moment I can't reproduce this issue any more. It happened >> some days ago, when I was viewing the webapp by Firefox and >> pressed F5 several times, when I noticed that Firefox sometimes >> displayed HTTP Headers as plain text. I used a network sniffer to >> see what the responses looked like, and found that HTTP 304 >> responses with a chunked body (which all belonged to >> images (png, jpeg) and css files). > > OK, I have experimented a bit and can reproduce the issue (with the unfixed > version of ISAPI redirector 1.2.31). > > I have used a webapp with custom Error pages (static html files). My web.xml > looks like this: > <error-page> > <error-code>404</error-code> > <location>/WEB-INF/errorpages/404.htm</location> > </error-page> > > Now if I do a GET-Request with an "If-modified-since" header to a file which > doesn't exist, Tomcat returns a 302 Not Modified response instead of 404 Not > Found. I think this is because Tomcat compares the date after the > "Is-modified-since" header to the date of the static 404 error file, thus > returning 302 instead of 404. > > If such a request to an non-existing file is processed through the ISAPI > redirector, it used transfer-encoding chunked. > Example: > > Client: > > GET /AUrlToAFileWhichDoesNotExist.ico HTTP/1.1 > Host: www.mydomain.net > Keep-Alive: 115 > Connection: keep-alive > If-Modified-Since: Mon, 08 Nov 2010 15:07:52 GMT > > > Server: > > HTTP/1.1 304 Not Modified > Date: Mon, 29 Nov 2010 20:20:52 GMT > Server: Microsoft-IIS/6.0 > ETag: W/"1285-1289228872000" > Transfer-Encoding: chunked > > 0 > > > But if you request a file which does exist, it uses the Content-length: 0 > header. > > Server: > > HTTP/1.1 304 Not Modified > Date: Mon, 29 Nov 2010 20:21:41 GMT > Server: Microsoft-IIS/6.0 > ETag: W/"1150-1290883084000" > Content-Length: 0 > > > Now the problem is, why is Tomcat returning a 302 Not Modified status for > the static 404 errorpage, instead of 404 Not found? Is this a Tomcat bug, or > have I done something wrong in my web.xml? I am using Tomcat 7.0.5.
So, if you can consistently repeat this, can you also confirm that changing the date of the static error page prevents the 304 from being sent on a subsequent request? p
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature