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

Multiple subprotocols are not supported in websockets handshake #2606

Closed
RomanBrodetski opened this issue Jul 19, 2019 · 1 comment
Milestone

Comments

@RomanBrodetski
Copy link
Contributor

@RomanBrodetski RomanBrodetski commented Jul 19, 2019

According to the Websockets RFC, a websocket client can send multiple values in Sec-WebSocket-Protocol header.
However, the WebSocketRequest case class has a subprotocol field of type Option[String]. Passing subprotocols as comma separated values there doesn't work either, as in this case the handshake fails when the server responds with one of the subprotocols (see https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/impl/engine/ws/Handshake.scala#L271).

It seems like this feature is only missing on the WebSocketRequest level - the Option[String] is then converted to Seq[String] with .toList() (see here). Instead, the WebSocketRequest should accept the subprotocols as a Seq[String].

@jrudolph

This comment has been minimized.

Copy link
Member

@jrudolph jrudolph commented Jul 23, 2019

Fixed in #2607.

@jrudolph jrudolph closed this Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.