Lagom: Duplicate Sec-WebSocket-Protocol headers in response

Created on 27 Jul 2019  路  7Comments  路  Source: lagom/lagom

Potential bug with websockets response. I get 2x Sec-WebSocket-Protocol headers in response if I open websocket with a protocol parameter in JS like this var socket = new WebSocket("ws://localhost:9000/ws", "some-arbitrary-text");

Lagom 1.5.1
Typical bidi streaming service signature: def stream(): ServiceCall[Source[String, NotUsed], Source[String, NotUsed]]

good first issue help wanted

Most helpful comment

Chrome throws a console error about that behavior (duplicate headers) and websocket client dies. So it's kind of blocking issue really.

play2.js:74 WebSocket connection to 'ws://localhost:9000/ws' failed: Error during WebSocket handshake: 'Sec-WebSocket-Protocol' header must not appear more than once in a response

All 7 comments

Thanks for reporting. Apart from that, do you observe any mal-functioning on the client-side caused by this duplication?

Chrome throws a console error about that behavior (duplicate headers) and websocket client dies. So it's kind of blocking issue really.

play2.js:74 WebSocket connection to 'ws://localhost:9000/ws' failed: Error during WebSocket handshake: 'Sec-WebSocket-Protocol' header must not appear more than once in a response

Ok, fair enough.

Would you have time to send a PR for this?

any workaround for this?

Hi @jayachandrak, this is not currently planned as a high priority on our short-term schedule but if you can send a PR we'll gladly have a look and merge it.

This issue still persists and the fix has not been implemented or rolled out. Why? This basically blocks web socket development in Chrome and even in iOS.

Yes. This fix not backported to 1.6.X.
I think we can do that. @octonato WDYT?

Was this page helpful?
0 / 5 - 0 ratings