Issue is reproducible when you create new RestClient by adding Accept-Encoding: gzip as default header and try to read response body.

RestClient.builder().baseUrl("https://example.com")
                .defaultHeader("Accept-Encoding", "gzip")
                .requestFactory(new JdkClientHttpRequestFactory())
                .build();

Have you considered asking for help on stackoverflow.com?

Yes. All documentation say that JDK Http Client only handles HTTP2 compressed headers automatically but cannot handle response body compressed using gzip / br / deflate, etc

** Enhancements requests ** We need to enhance JdkClientHttpRequestFactory to add new method similar to read-timeout workaround and create a custom jdk BodyHandler that wraps the decompression logic by using JDK inbuilt GZIPInputStream when response contains Content-Encoding header, etc.

Changes would be needed in JdkClientHttpRequestFactory, JdkHttpClientRequest