kenhuuu commented on code in PR #2622: URL: https://github.com/apache/tinkerpop/pull/2622#discussion_r1625347826
########## gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketAuthorizationHandler.java: ########## @@ -68,11 +68,19 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { final Bytecode bytecode = (Bytecode) requestMessage.getArgs().get(Tokens.ARGS_GREMLIN); final Map<String, String> aliases = (Map<String, String>) requestMessage.getArgs().get(Tokens.ARGS_ALIASES); final Bytecode restrictedBytecode = authorizer.authorize(user, bytecode, aliases); - final RequestMessage restrictedMsg = RequestMessage.build(Tokens.OPS_BYTECODE). + final RequestMessage.Builder restrictedMsgBuilder = RequestMessage.build(Tokens.OPS_BYTECODE). Review Comment: I think you could clean this up a little by using the from() (https://github.com/apache/tinkerpop/blob/3.6-dev/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/message/RequestMessage.java#L107) to make a copy of the old RequestMessage and then just override the ARGS_GREMLIN with restrictedBytecode. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org