diff --git a/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSockets.kt b/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSockets.kt index 0ce49cca769..ccf019208f7 100644 --- a/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSockets.kt +++ b/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSockets.kt @@ -185,6 +185,11 @@ public class WebSockets internal constructor( } LOGGER.trace("Receive websocket session from ${context.request.url}: $session") + + if (plugin.maxFrameSize != Long.MAX_VALUE) { + session.maxFrameSize = plugin.maxFrameSize + } + val clientSession: ClientWebSocketSession = when (info.type) { DefaultClientWebSocketSession::class -> { val defaultSession = plugin.convertSessionToDefault(session) @@ -201,7 +206,9 @@ public class WebSockets internal constructor( } } - else -> DelegatingClientWebSocketSession(context, session) + else -> { + DelegatingClientWebSocketSession(context, session) + } } proceedWith(HttpResponseContainer(info, clientSession))