jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [servlet-spec users] Re: Re: Re: Re: Re: Re: Re: Re: revised trailer proposals

From: Greg Wilkins <gregw_at_webtide.com>
Date: Thu, 20 Apr 2017 07:48:28 +1000

On 20 April 2017 at 06:52, Shing Wai Chan <shing.wai.chan_at_oracle.com> wrote:

> So, the former means no TE header.
> Do we need to distinguish this in #getTrailers()? Or we have to check the
> presence of TE header?
> So we have to do the null check for #getTrailers() here. Do we want that?
>

It is more that TE header as Trailers can be carried on chunked HTTP/1.1 or
HTTP/2, plus some other transports, so the text needs to not be protocol
specific.

Now I'm not sure if we really need to know the difference between
no-trailers and not-able-to-transport-trailers, but the difference between
a null return and an empty map is a good way to convey that semantic so why
not use it.

Note also that Simone Bordet has pointed out to me that Map<String,String>
is a poor data structure to use as it is case sensitive and trailers are
case insensitive. If we are to use map, then we should say that all the
keys are set as lowercase rather than any case passed by the client -
which would make it hard to find headers if strange casings were passed.

cheers











-- 
Greg Wilkins <gregw@webtide.com> CTO http://webtide.com