static void autoAddHttpExtractor(NettyContext c, String name, ChannelHandler handler){ if (handler instanceof ByteToMessageDecoder || handler instanceof ByteToMessageCodec || handler instanceof CombinedChannelDuplexHandler) { String extractorName = name+"$extractor"; if(c.channel().pipeline().context(extractorName) != null){ return; } c.channel().pipeline().addBefore(name, extractorName, HTTP_EXTRACTOR); if(NettyContext.isPersistent(c.channel())){ c.onClose(() -> c.removeHandler(extractorName)); } } }