Skip to content

Commit 8cd85d5

Browse files
nikhlagrwldiemol
andauthored
[java] fix null request in case of chunked request (#13113)
* [java] fix null request in case of chunked request * set the request in case of a protocol upgrade * fix linting issues --------- Co-authored-by: Diego Molina <[email protected]>
1 parent 8f8c856 commit 8cd85d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/src/org/openqa/selenium/netty/server/RequestConverter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Ex
6767
io.netty.handler.codec.http.HttpRequest nettyRequest =
6868
(io.netty.handler.codec.http.HttpRequest) msg;
6969

70-
if (HttpUtil.is100ContinueExpected(nettyRequest)) {
71-
ctx.write(new HttpResponse().setStatus(100));
72-
return;
73-
}
74-
7570
if (nettyRequest.headers().contains("Sec-WebSocket-Version")
7671
&& "upgrade".equalsIgnoreCase(nettyRequest.headers().get("Connection"))) {
7772
// Pass this on to later in the pipeline.
@@ -85,6 +80,11 @@ protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Ex
8580
return;
8681
}
8782

83+
if (HttpUtil.is100ContinueExpected(nettyRequest)) {
84+
ctx.write(new HttpResponse().setStatus(100));
85+
return;
86+
}
87+
8888
request.setAttribute(
8989
AttributeKey.HTTP_SCHEME.getKey(), nettyRequest.protocolVersion().protocolName());
9090
request.setAttribute(

0 commit comments

Comments
 (0)