Check for native WebSocket message

In addition to the changes in
313a7836b0 to support passing on a
the underlying WebSocket message, this commits checks for its
availability.

Closes gh-25099
This commit is contained in:
Rossen Stoyanchev
2020-07-27 09:22:03 +03:00
parent 86c52a842f
commit a4c157fc09

View File

@@ -78,6 +78,9 @@ public abstract class NettyWebSocketSessionSupport<T> extends AbstractWebSocketS
}
protected WebSocketFrame toFrame(WebSocketMessage message) {
if (message.getNativeMessage() != null) {
return message.getNativeMessage();
}
ByteBuf byteBuf = NettyDataBufferFactory.toByteBuf(message.getPayload());
if (WebSocketMessage.Type.TEXT.equals(message.getType())) {
return new TextWebSocketFrame(byteBuf);