tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: Status 204 (no content) and Content-Type header
Date Sat, 04 May 2013 20:21:57 GMT
On 04/05/2013 20:43, Rossen Stoyanchev wrote:
> It appears that Tomcat ignores the Content-Type header when the
> status is set to 204 (No Content).

Correct. It happens in AbstractHttp11Processor.prepareResponse()

> I can see the rational for that,
> however is there a strong reason why Tomcat should care if it is set
> by the application?


I took a look at RFC 2616. Section 10.2.5 states that a 204 response may
contain updated metainformation in the form of entity headers and, as
per section 7.1, Content-Type is an entity header so it should be not be
skipped if set for a 204 response.

On those grounds, this is a Tomcat bug.

> There are some corner cases [1].

That looks more like a bug in 3rd-party code. Bugs in 3rd party code are
rarely sufficient justification for changing Tomcat's behaviour. In this
case, the RFC2616 argument is a much stronger one and it looks to me
like the code will be changed (regardless of [1], not because of it).


> Rossen
> [1]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message