[ 
https://issues.apache.org/jira/browse/TINKERPOP-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786445#comment-17786445
 ] 

ASF GitHub Bot commented on TINKERPOP-2830:
-------------------------------------------

vkagamlyk commented on code in PR #2328:
URL: https://github.com/apache/tinkerpop/pull/2328#discussion_r1394545976


##########
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java:
##########
@@ -62,28 +63,35 @@ public void configure(final ChannelPipeline pipeline) {
     public void channelRead(final ChannelHandlerContext ctx, final Object obj) 
{
         final ChannelPipeline pipeline = ctx.pipeline();
         if (obj instanceof HttpMessage && 
!WebSocketHandlerUtil.isWebSocket((HttpMessage)obj)) {
-            // if the message is for HTTP and not websockets then this handler 
injects the endpoint handler in front
-            // of the HTTP Aggregator to intercept the HttpMessage. Therefore 
the pipeline looks like this at start:
+            // If the message is for HTTP and not WS then this handler injects 
the HTTP user-agent and endpoint handlers
+            // in front of the HTTP aggregator to intercept the HttpMessage.
+            // This replaces the WS server protocol handler so that the 
pipeline initially looks like this:
             //
             // IdleStateHandler -> HttpResponseEncoder -> HttpRequestDecoder ->
             //    WsAndHttpChannelizerHandler -> HttpObjectAggregator ->
+            //    WebSocketServerProtocolHandler ->
             //    WebSocketServerCompressionHandler -> 
WebSocketServerProtocolHandshakeHandler -> (more websockets)
             //
-            // and shifts to (setting aside the authentication condition):
+            // and shifts to this (setting aside the authentication condition):
             //
             // IdleStateHandler -> HttpResponseEncoder -> HttpRequestDecoder ->
             //    WsAndHttpChannelizerHandler -> HttpObjectAggregator ->
-            //    HttpGremlinEndpointHandler ->
+            //    HttpUserAgentHandler -> HttpGremlinEndpointHandler ->
             //    WebSocketServerCompressionHandler - 
WebSocketServerProtocolHandshakeHandler -> (more websockets)
+            ChannelHandler test = pipeline.get(PIPELINE_REQUEST_HANDLER);

Review Comment:
   nit: remove debug code





> Handle User-Agent from HTTP Requests to server
> ----------------------------------------------
>
>                 Key: TINKERPOP-2830
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2830
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.5.4
>            Reporter: Cole Greer
>            Priority: Critical
>
> Changes are being introduced in 
> [2480|https://issues.apache.org/jira/browse/TINKERPOP-2480] which add a user 
> agent which is sent as a request header during web socket handshakes. 
> Originally 2480 was planned to also include the server accepting user agents 
> from http requests but this has now fallen outside of the scope. This ticket 
> is to complete the user agent feature by adding the ability for the server to 
> accept user agents in http requests in addition to web sockets.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to