From 69facceec3f4a82feb6d555c378c70c6245d63a5 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Mon, 4 Jan 2021 16:11:28 +1100 Subject: [PATCH] Issue #5850 - set the UpgradeRequest in the Javax FrameHandlerFactory Signed-off-by: Lachlan Roberts --- .../javax/client/internal/JavaxClientUpgradeRequest.java | 9 --------- .../javax/common/JavaxWebSocketFrameHandlerFactory.java | 5 ++++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java index 8fbe5a4282e..837ac96b40a 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java @@ -16,8 +16,6 @@ package org.eclipse.jetty.websocket.javax.client.internal; import java.net.URI; import java.security.Principal; -import org.eclipse.jetty.client.HttpResponse; -import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.websocket.core.FrameHandler; import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; @@ -34,13 +32,6 @@ public class JavaxClientUpgradeRequest extends CoreClientUpgradeRequest implemen frameHandler = clientContainer.newFrameHandler(websocketPojo, this); } - @Override - public void upgrade(HttpResponse response, EndPoint endPoint) - { - frameHandler.setUpgradeRequest(this); - super.upgrade(response, endPoint); - } - @Override public FrameHandler getFrameHandler() { diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java index fbd802c0982..a56ebb1fbb7 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java @@ -165,13 +165,16 @@ public abstract class JavaxWebSocketFrameHandlerFactory errorHandle = InvokerUtils.bindTo(errorHandle, endpoint); pongHandle = InvokerUtils.bindTo(pongHandle, endpoint); - return new JavaxWebSocketFrameHandler( + JavaxWebSocketFrameHandler frameHandler = new JavaxWebSocketFrameHandler( container, endpoint, openHandle, closeHandle, errorHandle, textMetadata, binaryMetadata, pongHandle, config); + + frameHandler.setUpgradeRequest(upgradeRequest); + return frameHandler; } public static MessageSink createMessageSink(JavaxWebSocketSession session, JavaxWebSocketMessageMetadata msgMetadata)