jsr369-experts@servlet-spec.java.net

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

From: Mark Thomas <markt_at_apache.org>
Date: Thu, 01 Jan 2015 11:23:04 +0000

On 01/01/2015 10:42, Greg Wilkins wrote:
>
>
> On 31 December 2014 at 20:18, Mark Thomas <markt_at_apache.org
> <mailto: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.

Exactly.

Mark


>
> 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 <mailto: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.