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 2013/07/10 02:35:33 UTC

[Bug 55228] New: AbstractHttp11Processor overwrites Date header, even when set by application

https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

            Bug ID: 55228
           Summary: AbstractHttp11Processor overwrites Date header, even
                    when set by application
           Product: Tomcat 6
           Version: 6.0.37
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: fern@alum.mit.edu

If the application sets the Date header, then it is most likely for caching
purposes and Tomcat needs to return it as is.



A consistent Date header is very important for proper Age/Max-Age calculations.

http://www.w3.org/Protocols/HTTP/Issues/add-age.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
If a bug affects multiple versions open an issue (as you have done) against the
earliest supported version you want to see the fix in. Fixes are applied to
trunk and then back-ported through each supported version until the bug the
issue was reported against is reached. So this will be fixed (assuming the bug
is valid and it looks like it is at first glance) in trunk, 7.0.x and 6.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

--- Comment #1 from fern@alum.mit.edu <fe...@alum.mit.edu> ---
I opened this bug against Tomcat6 since that is what we're using, but this bug
exists on all Tomcat7, as well, and most likely Tomcat8.  I'm not sure how to
deal with that.



Looking at tomcat-embed-core-7.0.42.jar:
AbstractHttp11Processor.prepareResponse
line: 1458

// Add date header
headers.setValue("Date").setString(FastHttpDateFormat.getCurrentDate());


You see that it sets the Date header, not checking if it had been already set
by that application.  Should be able to easily wrap it with:

if ( headers.getValue("Date") == null ) {
  ...
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Fair enough.

This has been fixed for trunk and 7.0.x and will be included in 7.0.43 onwards.

The fix has been proposed for 6.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

fern@alum.mit.edu <fe...@alum.mit.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fern@alum.mit.edu

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
I'm currently leaning to resolving this as invalid. As an origin server, Tomcat
is required by RFc2616 to set the date header (using the current time) on every
request.

I'd be prepared to implement this change given a valid use case but I currently
don't see a valid, RFC 2616 compliant reason for an application to set the date
header.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
Fixed in 6.0.x and will be included in 6.0.38 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55228] AbstractHttp11Processor overwrites Date header, even when set by application

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55228

--- Comment #4 from fern@alum.mit.edu <fe...@alum.mit.edu> ---
The valid usecase is that we have implemented a Caching Filter (and many people
have to).  And per that spec, we're supposed to return the Date header of when
the original response was cached/generated.  It's required so that clients can
properly calculate the age of the returned resource.  But Tomcat keeps
overwriting the Date header, thus messing up the age calculation.

http://www.w3.org/Protocols/HTTP/Issues/add-age.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org