jsr356-experts@websocket-spec.java.net

[jsr356-experts] Re: Header names case (in)sensitivity in HandshakeResponse

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Fri, 28 Nov 2014 13:50:19 +0100

Hi Rémy,

your interpretation corresponds to what we did in reference
implementation and how we understood I agree that we should make it
clear in HandshakeResponse javadoc, can you please file an issue against
the spec? If you are going to do that, please mention also
HandshakeRequest - current javadoc on getHeaders() method is:

     /**
      * Return the read only Map of Http Headers that came with the
handshake request. The header names
      * are case insensitive.
      *
      * @return the list of headers.
      */
     Map<String, List<String>> getHeaders();

which is also incorrect (case insensitivness is not correctly described
+ @return could use some correction as well).

Thanks!
Pavel

On 28/11/14 12:37, Remy Maucherat wrote:
> Hi,
>
> The behavior I can see from the TCK is that the header map returned by HandshakeResponse respects case for keys and values, but should be case insensitive for keys on lookups. This is very coherent with HTTP (and Servlets) so if my interpretation is right I fully agree with this, but is not specified anywhere and is not so intuitive due to the collection type used here.
>
> For example, the javadoc for the getHeaders method is: Return the list of Http headers sent by the web socket server.
> This javadoc entry would be the best location to describe the desired behavior.
>
> Thanks,
> Rémy
>
>