tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47451] NPE if response contains null content-encoding header
Date Fri, 02 Oct 2009 11:34:09 GMT

--- Comment #1 from Konstantin Kolinko <> 2009-10-02 04:34:03
PDT ---
(In reply to comment #0)
> A brief analysis of the JnlpDownloadServlet code shows that the
> content-encoding
> header on the response is being set to null in
> DownloadResponse$FileDownloadResponse.
> (...)
> Since this occurs with the JnlpDownloadServlet provided by Sun (see
> I imagine more people might be running into this problem.

Null should not be used as a value in a call to

The servlet spec (including the proposed final draft of servlet-3.0) does not
define the behavior of null value for those methods, but certainly such value
cannot be transmitted over the wire and cannot be interpreted as removal of the
header, as the spec does not allow removal of the headers.

The same applies to null value for name.

Thus expect #setHeader(name, null) to fail in a container-dependent way. I
would prefer an early failure with an NPE in setHeader/addHeader, as opposed to
the late failure seen by the OP. Should we make it configurable, e.g. with

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

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

View raw message