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 2019/08/30 12:15:22 UTC

[Bug 63710] New: HTTP 304 NOT MODIFIED should not set Content-Length

https://bz.apache.org/bugzilla/show_bug.cgi?id=63710

            Bug ID: 63710
           Summary: HTTP 304 NOT MODIFIED should not set Content-Length
           Product: Tomcat 9
           Version: 9.0.24
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: boris_petrov@live.com
  Target Milestone: -----

Tomcat seems to set the `Content-Length` header to 0 when the HTTP response
code is 304 (Not Modified). This should not be done. Some references:

https://trac.nginx.org/nginx/ticket/459
https://github.com/playframework/playframework/issues/3899

-- 
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 63710] HTTP 304 NOT MODIFIED should not set Content-Length

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

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
That is a question for the users mailing list.

-- 
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 63710] HTTP 304 NOT MODIFIED should not set Content-Length

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

--- Comment #2 from Boris Petrov <bo...@live.com> ---
Is it possible that the default Tomcat configuration adds this header?

When I run our integration tests (which use the embedded Tomcat), this header
is not present in these responses. However, in production the header is there.

How do I debug who adds it?

-- 
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 63710] HTTP 304 NOT MODIFIED should not set Content-Length

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

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

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

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
The default servlet does not do this.

Tomcat does not do this if a Servlet returns a 304 response.

An application may well do this but that would be an application issue.

-- 
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 63710] HTTP 304 NOT MODIFIED should not set Content-Length

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

Boris Petrov <bo...@live.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |---
             Status|RESOLVED                    |REOPENED

--- Comment #4 from Boris Petrov <bo...@live.com> ---
As noted in a mailing list message:

https://mail-archives.apache.org/mod_mbox/tomcat-users/201909.mbox/%3C0be01580-54c6-c5c4-16b7-000a577c4ebb%40profuzdigital.com%3E

This happens only on HTTP/2 and is indeed a Tomcat bug.

-- 
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 63710] HTTP 304 NOT MODIFIED should not set Content-Length

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

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

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

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- master for 9.0.25 onwards
- 8.5.x for 8.5.46 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