WebSocketTransportHandler passes Collections.<String, Object>emptyMap() to HandshakeHandler [SPR-12716] #17313
WebSocketTransportHandler passes in an empty Map into the delegate
Rossen Stoyanchev commented
With SockJS the actual "session" is of type SockJsSession and for the websocket transport that's
The attributes map that is populated by HandshakeInterceptors is correctly passed to the SockJsSession (TransportHandlingSockJsService line 238) and that's all that should matter for the most part since no one should ever see the wrapped WebSocketSession. This is why we pass an empty map in WebSocketTransportHandler.
That said it is true that the delegate HandshakeHandler won't be able to add any attributes. Is that the actual issue you're running into? Now that I look at this again we might as well pass the attributes from the SockJsSession into the handshakeHandler, i.e. change from
Does that make sense?
Rob Winch commented
Thanks for the response.
My actual issue is actually a bit incidental actually. I was using a TestHandshakeHandler to verify that a custom HandshakeInterceptor was properly integrated with the configuration. I felt that this is an actual issue.
I think that changing from