netty5/codec-http/src
Andrey Mizurov f40b4f15a6
Override Sec-WebSocket-Protocol websocket handshake response header after custom headers to avoid duplication (#10793)
Motivation:

According rfc (https://tools.ietf.org/html/rfc6455#section-11.3.4), `Sec-WebSocket-Protocol` header field MUST NOT appear
more than once in an HTTP response.
At the moment we can pass `Sec-WebSocket-Protocol`  via custom headers and it will be added to response.

Modification:

Change method add() to set() for avoid duplication. If we pass sub protocols in handshaker constructor it means that they are preferred over custom ones.

Result:

Less error prone behavior.
2020-11-19 09:49:44 +01:00
..
main Override Sec-WebSocket-Protocol websocket handshake response header after custom headers to avoid duplication (#10793) 2020-11-19 09:49:44 +01:00
test Override Sec-WebSocket-Protocol websocket handshake response header after custom headers to avoid duplication (#10793) 2020-11-19 09:49:44 +01:00