You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When org.eclipse.jetty.websocket.core.internal.messages.StringMessageSink#accept is called with a Frame larger than configured the MessageTooLargeException is thrown. This behavior is expected.
The problem is that in this state the WS connection is not closed which is not aligned with org.eclipse.jetty.websocket.api.WebSocketPolicy JavaDoc - Text messages over this maximum will result in a close code 1009 {@link StatusCode#MESSAGE_TOO_LARGE}
The interesting thing is that setting WebSocketPolicy#setMaxTextMessageSize with a value lower than the incoming text message solves the problem. The error is propagated as expected. But using a default value doesn't leads to this problem.
Right after the exception in DEBUG logging mode, the following information is printed:
onWebSocketClose/onWebSocketError methods are not called. From the client's perspective (Chrome browser in my case) the connection is not closed either.
Searching through relevant issues I can mention #7351 as it has similar symptoms.
From my point of view PerMessageDeflateExtension should somehow handle the underlying exception (close the connection) but it does nothing like that in this case.
raymank26
changed the title
A MessageTooLargeException doesn't close WebSocket connection
A MessageTooLargeException doesn't close a WebSocket connection
Jun 8, 2023
Jetty version(s)
11.0.15
Java version/vendor
(use: java -version)
openjdk version "11.0.11" 2021-04-20
OS type/version
MacOs Ventura (13.2.1)
Description
When
org.eclipse.jetty.websocket.core.internal.messages.StringMessageSink#accept
is called with aFrame
larger than configured theMessageTooLargeException
is thrown. This behavior is expected.The problem is that in this state the WS connection is not closed which is not aligned with
org.eclipse.jetty.websocket.api.WebSocketPolicy
JavaDoc -Text messages over this maximum will result in a close code 1009 {@link StatusCode#MESSAGE_TOO_LARGE}
The interesting thing is that setting
WebSocketPolicy#setMaxTextMessageSize
with a value lower than the incoming text message solves the problem. The error is propagated as expected. But using a default value doesn't leads to this problem.Right after the exception in DEBUG logging mode, the following information is printed:
onWebSocketClose/onWebSocketError
methods are not called. From the client's perspective (Chrome browser in my case) the connection is not closed either.Searching through relevant issues I can mention #7351 as it has similar symptoms.
From my point of view
PerMessageDeflateExtension
should somehow handle the underlying exception (close the connection) but it does nothing like that in this case.How to reproduce?
A reproducer project is available at https://github.com/raymank26/jetty-11.0.15-websocket-permessage-deflate
The text was updated successfully, but these errors were encountered: