Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 26605 invoked from network); 29 Nov 2010 20:39:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Nov 2010 20:39:20 -0000 Received: (qmail 37824 invoked by uid 500); 29 Nov 2010 20:39:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 37779 invoked by uid 500); 29 Nov 2010 20:39:16 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 37770 invoked by uid 99); 29 Nov 2010 20:39:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Nov 2010 20:39:16 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=MSGID_MULTIPLE_AT,RCVD_IN_DNSWL_NONE,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.25.134.20] (HELO mailout08.t-online.de) (194.25.134.20) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Nov 2010 20:39:09 +0000 Received: from fwd05.aul.t-online.de (fwd05.aul.t-online.de ) by mailout08.t-online.de with smtp id 1PNAUp-00068P-Eg; Mon, 29 Nov 2010 21:38:47 +0100 Received: from pc640dcf78e5 (V8maCvZOYhHxLNKFKkdwAAOVHOUT8Dj6f8G+13+8BH2GucSQxu7Ox7KnpzpqYZ7wfF@[91.10.81.53]) by fwd05.aul.t-online.de with esmtp id 1PNAUh-25WaI40; Mon, 29 Nov 2010 21:38:39 +0100 From: =?iso-8859-1?Q?Konstantin_Prei=DFer?= To: Subject: Re: Tomcat Jakarta 1.2.31 ISAPI Reconnector incorrectly sending Content body with HTTP 304 Status Date: Mon, 29 Nov 2010 21:38:38 +0100 Message-ID: <000001cb9005$67674b10$3635e130$@preisser@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuQBWZ063VYTtnMRIS4vwjgFMFRCg== Content-Language: de X-ID: V8maCvZOYhHxLNKFKkdwAAOVHOUT8Dj6f8G+13+8BH2GucSQxu7Ox7KnpzpqYZ7wfF@t-dialin.net X-TOI-MSGID: fb445690-79fb-4364-9ff2-6d11d0a902dc > 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: 404 /WEB-INF/errorpages/404.htm 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. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org