class UriWithBracketsFilter implements GlobalFilter, Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {<FILL_FUNCTION_BODY>}

    @Override
    public int getOrder() {
        return ReactiveLoadBalancerClientFilter.LOAD_BALANCER_CLIENT_FILTER_ORDER + 1;
    }
}

        String query = exchange.getRequest().getURI().getRawQuery();
        if (query != null && query.contains("%") && (query.contains("[") || query.contains("]"))) {
            try {
                String badUrl = exchange.getAttributes().get(GATEWAY_REQUEST_URL_ATTR).toString();
                String fineUrl = badUrl.substring(0, badUrl.indexOf('?') + 1) +
                        query.replace("[", "%5B").replace("]", "%5D");
                exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, new URI(fineUrl));
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
        }
        return chain.filter(exchange);
    
<no_super_class>