Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Sec-WebSocket-Protocol headers in response #2135

Closed
kotdv opened this issue Jul 27, 2019 · 7 comments · Fixed by #2647
Closed

Duplicate Sec-WebSocket-Protocol headers in response #2135

kotdv opened this issue Jul 27, 2019 · 7 comments · Fixed by #2647
Labels
good first issue Good for newcomers help wanted Ready and waiting for a volunteer

Comments

@kotdv
Copy link

kotdv commented Jul 27, 2019

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]]

@kotdv kotdv changed the title Duplicate Sec-WebSocket-Protocol headers response Duplicate Sec-WebSocket-Protocol headers in response Jul 27, 2019
@octonato
Copy link
Member

octonato commented Jul 29, 2019

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

@octonato octonato added good first issue Good for newcomers help wanted Ready and waiting for a volunteer and removed triage labels Jul 29, 2019
@kotdv
Copy link
Author

kotdv commented Jul 29, 2019

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

@octonato
Copy link
Member

Ok, fair enough.

Would you have time to send a PR for this?

@jayachandrak
Copy link

any workaround for this?

@ignasi35
Copy link
Contributor

ignasi35 commented Nov 4, 2019

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.

borgespires added a commit to borgespires/lagom that referenced this issue Jan 27, 2020
…r in response when a subprotocol is defined
borgespires added a commit to borgespires/lagom that referenced this issue Jan 27, 2020
…r in response when a subprotocol is defined
borgespires added a commit to borgespires/lagom that referenced this issue Jan 27, 2020
…r in response when a subprotocol is defined
borgespires added a commit to borgespires/lagom that referenced this issue Jan 27, 2020
…r in response when a subprotocol is defined
octonato added a commit that referenced this issue Jan 29, 2020
Fixes #2135 - Duplicate Sec-WebSocket-Protocol headers in response
@kroeberk
Copy link

kroeberk commented Apr 1, 2021

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.

@ihostage
Copy link
Contributor

ihostage commented Apr 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Ready and waiting for a volunteer
Development

Successfully merging a pull request may close this issue.

6 participants