Propagate max frame length to WebSocket session#36370
Propagate max frame length to WebSocket session#36370aavoronin93 wants to merge 1 commit intospring-projects:mainfrom
Conversation
f5996b0 to
83441b4
Compare
rstoyanchev
left a comment
There was a problem hiding this comment.
For Reactor Netty, it looks like originally we had an maxFramePayloadLength field that was passed to ReactorNettyWebSocketSession that was then replaced in favour of the WebSocketClientSpec from Reactor Netty. However, the change 2ed281f to make the switch didn't pass the value into the session constructor, so that's a regression in 7.0.
For Jetty, however, I'm not sure yet why we need to pass the settings from the Jetty WebSocketClient to the Jetty Session, with the latter created by the former. Could you drop the Jetty changes, and submit them as a separate PR, please?
This change ensures that maxFramePayloadLength from WebsocketClientSpec is passed to ReactorNettyWebSocketSession. Previously, the session used the default 64KB limit regardless of client configuration, causing TooLongFrameException when receiving larger frames from servers like Tomcat or Jetty. Closes spring-projectsgh-36369 Signed-off-by: Artem Voronin <artem.voronin.dev@gmail.com>
83441b4 to
3eca440
Compare
|
After closer investigation, I’ve confirmed that |


This PR ensures that
maxFramePayloadLengthfromWebsocketClientSpecis passed toReactorNettyWebSocketSession.Previously, the session used the default 64KB limit regardless of client configuration, causing
io.netty.handler.codec.TooLongFrameExceptionwhen receiving larger frames from servers like Tomcat or Jetty.Closes gh-36369
I have updated the PR to include a fix for
JettyWebSocketClientas well.The issue was consistent across both clients: session-level limits were not being synchronized with the client-level configuration. For Jetty, I've implemented this by configuring the native session during initialization within the
JettyWebSocketHandlerAdapter. For Reactor Netty, themaxFramePayloadLengthis now correctly propagated through the session constructor.I've also expanded the integration tests to verify the fix for both Reactor Netty and Jetty. All tests are passing.