tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Prei├čer <>
Subject Re: Tomcat Jakarta 1.2.31 ISAPI Reconnector incorrectly sending Content body with HTTP 304 Status
Date Mon, 29 Nov 2010 20:38:38 GMT
> 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:

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.


GET /AUrlToAFileWhichDoesNotExist.ico HTTP/1.1
Keep-Alive: 115
Connection: keep-alive
If-Modified-Since: Mon, 08 Nov 2010 15:07:52 GMT


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


But if you request a file which does exist, it uses the Content-length: 0


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.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message