From 7c19796eb22ced9aba703e52e76e58450e34d018 Mon Sep 17 00:00:00 2001 From: Koji Kawamura Date: Tue, 7 Mar 2017 17:08:47 +0900 Subject: [PATCH] NIFI-3561: Fix WS port forwarding Fixed service instance lookup to use local port so that it works when it is accessed through port forwarding. This fixes: #1568 Signed-off-by: Andre F de Miranda --- .../org/apache/nifi/websocket/jetty/JettyWebSocketServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketServer.java b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketServer.java index 267e7d1105..71e60a9dd4 100644 --- a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketServer.java +++ b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketServer.java @@ -127,7 +127,7 @@ public class JettyWebSocketServer extends AbstractJettyWebSocketService implemen @Override public Object createWebSocket(ServletUpgradeRequest servletUpgradeRequest, ServletUpgradeResponse servletUpgradeResponse) { final URI requestURI = servletUpgradeRequest.getRequestURI(); - final int port = requestURI.getPort(); + final int port = servletUpgradeRequest.getLocalPort(); final JettyWebSocketServer service = portToControllerService.get(port); if (service == null) {