Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

package io.undertow.websockets.vertx;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.undertow.websockets.handshake.WebSocketHttpExchange;
Expand Down Expand Up @@ -114,6 +115,13 @@ public void setResponseHeader(final CharSequence headerName, final String header
@Override
public void upgradeChannel(Consumer<Object> listener) {
response.headers().set(HttpHeaderNames.CONNECTION, "upgrade");

Http1xServerConnection connection = (Http1xServerConnection) request.connection();
ChannelHandlerContext context = connection.channelHandlerContext();
final ChannelHandler websocketChannelHandler = context.pipeline().get("websocketExtensionHandler");
if (websocketChannelHandler != null) {
context.pipeline().remove(websocketChannelHandler);
}
response.setStatusCode(101).end(new Handler<AsyncResult<Void>>() {
@Override
public void handle(AsyncResult<Void> event) {
Expand Down