Skip to content

Commit e3dca48

Browse files
committed
WebSocketClientProtocolHandler: make default allowMaskMismatch = true
1 parent bebd5c5 commit e3dca48

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

netty-websocket-http1-test/src/test/java/com/jauntsdn/netty/handler/codec/http/websocketx/WebSocketValidationTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@ void tearDown() throws Exception {
6060
}
6161
}
6262

63+
@Test
64+
void serverBuilderMinimalConfigIsValid() {
65+
WebSocketServerProtocolHandler serverProtocolHandler =
66+
WebSocketServerProtocolHandler.create()
67+
.webSocketCallbacksHandler(
68+
(ctx, webSocketFrameFactory) -> {
69+
throw new AssertionError("never called");
70+
})
71+
.build();
72+
}
73+
74+
@Test
75+
void clientBuilderMinimalConfigIsValid() {
76+
WebSocketClientProtocolHandler clientProtocolHandler =
77+
WebSocketClientProtocolHandler.create()
78+
.webSocketHandler(
79+
(ctx, webSocketFrameFactory) -> {
80+
throw new AssertionError("never called");
81+
})
82+
.build();
83+
}
84+
6385
@Timeout(15)
6486
@Test
6587
void frameSizeLimit() throws Exception {

netty-websocket-http1/src/main/java/com/jauntsdn/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public static final class Builder {
246246
private String subprotocol;
247247
private HttpHeaders headers;
248248
private boolean mask = true;
249-
private boolean allowMaskMismatch;
249+
private boolean allowMaskMismatch = true;
250250
private int maxFramePayloadLength = 65_535;
251251
private long handshakeTimeoutMillis = 15_000;
252252
private WebSocketCallbacksHandler webSocketHandler;

0 commit comments

Comments
 (0)