From aa492fb9b636af6e651e7508a97e031348eb3f68 Mon Sep 17 00:00:00 2001 From: Julian Scheid Date: Tue, 20 Oct 2015 23:12:18 +0200 Subject: [PATCH] ARTEMIS-271 Expose HttpRequest in WebSocketServerHandler --- .../artemis/core/protocol/stomp/WebSocketServerHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/WebSocketServerHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/WebSocketServerHandler.java index 62c41d3d51..425beba383 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/WebSocketServerHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/WebSocketServerHandler.java @@ -49,6 +49,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler private static final String WEBSOCKET_PATH = "/stomp"; + private HttpRequest httpRequest; private WebSocketServerHandshaker handshaker; private static final BinaryWebSocketEncoder BINARY_WEBSOCKET_ENCODER = new BinaryWebSocketEncoder(); @@ -75,6 +76,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler // Handshake WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(this.getWebSocketLocation(req), "v10.stomp,v11.stomp", false); + this.httpRequest = req; this.handshaker = wsFactory.newHandshaker(req); if (this.handshaker == null) { WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel()); @@ -140,6 +142,10 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler return "ws://" + req.headers().get(HttpHeaders.Names.HOST) + WEBSOCKET_PATH; } + public HttpRequest getHttpRequest() { + return this.httpRequest; + } + @Sharable private static final class BinaryWebSocketEncoder extends ChannelOutboundHandlerAdapter {