class RequestDecodeHandler implements MiddlewareHandler {

    public static RequestDecodeConfig config =
            (RequestDecodeConfig)Config.getInstance().getJsonObjectConfig(RequestDecodeConfig.CONFIG_NAME, RequestDecodeConfig.class);

    private final Map<String, ConduitWrapper<StreamSourceConduit>> requestEncodings = new CopyOnWriteMap<>();

    private volatile HttpHandler next;

    public RequestDecodeHandler() {
        List<String> decoders = config.getDecoders();
        for(int i = 0; i < decoders.size(); i++) {
            String decoder = decoders.get(i);
            if(Constants.ENCODE_DEFLATE.equals(decoder)) {
                requestEncodings.put(decoder, InflatingStreamSourceConduit.WRAPPER);
            } else if(Constants.ENCODE_GZIP.equals(decoder)) {
                requestEncodings.put(decoder, GzipStreamSourceConduit.WRAPPER);
            } else {
                throw new RuntimeException("Invalid decoder " + decoder + " for RequestDecodeHandler.");
            }
        }
    }

    @Override
    public HttpHandler getNext() {
        return next;
    }

    @Override
    public MiddlewareHandler setNext(HttpHandler next) {
        Handlers.handlerNotNull(next);
        this.next = next;
        return this;
    }

    @Override
    public boolean isEnabled() {
        return config.isEnabled();
    }

    @Override
    public void register() {
        ModuleRegistry.registerModule(RequestDecodeConfig.CONFIG_NAME, RequestDecodeHandler.class.getName(), Config.getNoneDecryptedInstance().getJsonMapConfigNoCache(RequestDecodeConfig.CONFIG_NAME), null);
    }

    @Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {<FILL_FUNCTION_BODY>}

    @Override
    public void reload() {
        config.reload();
        ModuleRegistry.registerModule(RequestDecodeConfig.CONFIG_NAME, RequestDecodeHandler.class.getName(), Config.getNoneDecryptedInstance().getJsonMapConfigNoCache(RequestDecodeConfig.CONFIG_NAME), null);
        if(logger.isInfoEnabled()) logger.info("RequestDecodeHandler is reloaded.");
    }
}

        ConduitWrapper<StreamSourceConduit> encodings = requestEncodings.get(exchange.getRequestHeaders().getFirst(Headers.CONTENT_ENCODING));
        if (encodings != null && exchange.isRequestChannelAvailable()) {
            exchange.addRequestWrapper(encodings);
            // Nested handlers or even servlet filters may implement logic to decode encoded request data.
            // Since the data is no longer encoded, we remove the encoding header.
            exchange.getRequestHeaders().remove(Headers.CONTENT_ENCODING);
        }
        Handler.next(exchange, next);
    
<no_super_class>