Skip to content

Commit

Permalink
Use already pre existing response headers to do websocket handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumelamirand committed Sep 19, 2024
1 parent 49d2754 commit 3ed9eac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
import io.netty.handler.codec.http.websocketx.WebSocketVersion;
Expand Down Expand Up @@ -475,7 +476,7 @@ private ServerWebSocket acceptHandshake() {
Http1xServerResponse response = request.response();
Object requestMetric = request.metric;
try {
handshaker.handshake(channel, request.nettyRequest());
handshaker.handshake(channel, request.nettyRequest(), (HttpHeaders) response.headers(), channel.newPromise());
} catch (Exception e) {
rejectHandshake(BAD_REQUEST.code());
throw e;
Expand Down

0 comments on commit 3ed9eac

Please sign in to comment.