jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [servlet-spec users] Re: Re: Re: Removing headers from the response

From: Greg Wilkins <gregw_at_intalio.com>
Date: Thu, 1 Jan 2015 11:42:25 +0100

On 31 December 2014 at 20:18, Mark Thomas <markt_at_apache.org> wrote:

>
> setHeader(null, anything) -> IAE or NO-OP
> (slight preference for NO-OP on reflection)
> setHeader(X, null) -> removes header
> setHeader(X, "") -> adds header with empty value
>
> Note: If the header has been removed, containsHeader(X) would return false
>
> containsHeader(null) would always return false
>
>
+1

but without a preference eitherway for IAE or NO-OP



> I'd also add something along the lines of the following clarification,
> e.g. to the setHeader() Javadoc.
>
> Note: Containers may still add headers (e.g. for specification
> compliance) after the request/response has returned to the container.
> Where these headers are not required for specification compliance the
> container should provide a container specific option to not add the header.
>

I think I'm on board with this.
What you are saying is that a container may add headers like
"Connection:close" for protocol compliance or like "Server: Wibble/9.9" for
non compliance reasons. Container must always be allowed to do protocol
compliance, but should allow other headers to be turned off.

That way we wont see the creation of filters whose job it is to remove the
Server header and who then complain if the container adds that during
commit.

cheers

-- 
Greg Wilkins <gregw_at_intalio.com>  @  Webtide - *an Intalio subsidiary*
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.