You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/05/23 18:00:20 UTC
DO NOT REPLY [Bug 42497] New: - 304 response should consistently include ETag header
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42497>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42497
Summary: 304 response should consistently include ETag header
Product: Tomcat 5
Version: 5.5.23
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Unknown
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: len.popp@gmail.com
According to the HTTP spec, if a server includes an ETag header when it sends a
file, it must also include the ETag when it sends a 304 (not-modified) response
for that file. Tomcat does not do this for static files - if you request a
static file and get a 200 response, the response has an ETag header; but if you
get a 304 resopnse, the ETag is omitted.
To reproduce:
- In a browser, request a static file from Tomcat (e.g. http://localhost/tomcat.gif)
- Make sure you get a 200 response (force reload or clear browser cache)
- Examine the response headers (using a browser plugin or whatever) - note that
there is an ETag header
- Request the same file again, getting a 304 (not-modified) response from Tomcat
- Examine the response headers - note there is no ETag
The 304 response should include an ETag header, because the 200 response had one.
Spec reference: RFC 2616 section 10.3.5 says:
"304 Not Modified
[...]
The response MUST include the following header fields:
[...]
- ETag and/or Content-Location, if the header would have been sent
in a 200 response to the same request"
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 42497] - 304 response should consistently include ETag header
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42497>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42497
------- Additional Comments From len.popp@gmail.com 2007-06-01 07:43 -------
I see how to fix this, but I'm not set up to compile Tomcat so someone else will
have to make the change and test it.
In org.apache.catalina.servlets.DefaultServlet, the serveResource method sets an
ETag header when it serves a file with a 200 or 206 response. To get it to add
the ETag to 304 responses, this needs to be added:
response.setHeader("ETag", getETag(resourceAttributes));
in two places where a a status of 304 (SC_NOT_MODIFIED) is set, in the methods
checkIfModifiedSince and checkIfNoneMatch.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 42497] - 304 response should consistently include ETag header
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42497>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42497
markt@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From markt@apache.org 2007-06-01 18:01 -------
Thanks for the patch. It has been applied to svn and will be in 5.5.24 and
6.0.14 onwards.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 42497] - 304 response should consistently include ETag header
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42497>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42497
------- Additional Comments From len.popp@gmail.com 2007-05-23 09:03 -------
Created an attachment (id=20251)
--> (http://issues.apache.org/bugzilla/attachment.cgi?id=20251&action=view)
Request and response headers showing the problem
I have attached a log file from Firefix LiveHTTPHeaders showing the problem.
A static file is requested twice. The first response is a 200 with an ETag
header,
the second response is a 304 without an ETag header.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 42497] - 304 response should consistently include ETag header
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42497>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42497
len.popp@gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|Unknown |Catalina
------- Additional Comments From len.popp@gmail.com 2007-06-01 07:45 -------
(I've changed the Component to "Catalina" because none of the more specific
Components seem appropriate. If that's wrong, please correct it.)
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 42497] - 304 response should consistently include ETag header
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42497>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42497
------- Additional Comments From len.popp@gmail.com 2007-06-15 15:50 -------
Tested OK in 5.5.24 release candidate.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org