Repository: micronaut-projects/micronaut-core
File: http-client/src/main/java/io/micronaut/http/client/netty/DefaultHttpClient.java (Java)

Code before:
 */
@Internal
public class DefaultHttpClient implements
        WebSocketClient,
        HttpClient,
        StreamingHttpClient,
        SseClient,
        ProxyHttpClient,
        RawHttpClient,
        Closeable,
        AutoCloseable {

    /**
     * Default logger, use {@link #log} where possible.
     */
    private static final Logger DEFAULT_LOG = LoggerFactory.getLogger(DefaultHttpClient.class);
    private static final int DEFAULT_HTTP_PORT = 80;
    private static final int DEFAULT_HTTPS_PORT = 443;

    /**
     * When following a 307 or 308 redirect, body related headers should be kept. Standard hop-by-hop
     * and host-specific headers are still dropped.
     */
    private static final HttpHeaders REDIRECT_HEADER_BLOCKLIST_PRESERVE_BODY = new DefaultHttpHeaders()
        .add(HttpHeaderNames.HOST, "")
        .add(HttpHeaderNames.TRANSFER_ENCODING, "")
        .add(HttpHeaderNames.CONNECTION, "");

    /**
     * When following 3xx responses (that are not 307 or 308) the request bodies are dropped and converted
     * to GET requests. Therefore, headers related to the content and length of the request body must
     * also be stripped along with standard hop-by-hop and host-specific headers.
     */
    private static final HttpHeaders REDIRECT_HEADER_BLOCKLIST = new DefaultHttpHeaders()
        .add(HttpHeaderNames.HOST, "")
        .add(HttpHeaderNames.TRANSFER_ENCODING, "")
        .add(HttpHeaderNames.CONNECTION, "")
        .add(HttpHeaderNames.CONTENT_TYPE, "")
        .add(HttpHeaderNames.CONTENT_LENGTH, "");

    protected MediaTypeCodecRegistry mediaTypeCodecRegistry;
    protected final ByteBufferFactory<ByteBufAllocator, ByteBuf> byteBufferFactory = new NettyByteBufferFactory();

    ConnectionManager connectionManager;

    private MessageBodyHandlerRegistry handlerRegistry;
    private final List<HttpFilterResolver.FilterEntry> clientFilterEntries;
    private final LoadBalancer loadBalancer;
    private final HttpClientConfiguration configuration;
    private final String contextPath;
    private final Charset defaultCharset;

Review comment (suggestion):
```suggestion
```

Transfer encoding should also stay, probably

Code after:
@Internal
public class DefaultHttpClient implements
        WebSocketClient,
        HttpClient,
        StreamingHttpClient,
        SseClient,
        ProxyHttpClient,
        RawHttpClient,
        Closeable,
        AutoCloseable {

    /**
     * Default logger, use {@link #log} where possible.
     */
    private static final Logger DEFAULT_LOG = LoggerFactory.getLogger(DefaultHttpClient.class);
    private static final int DEFAULT_HTTP_PORT = 80;
    private static final int DEFAULT_HTTPS_PORT = 443;

    /**
     * When following a 307 or 308 redirect, body related headers should be kept. Standard hop-by-hop
     * and host-specific headers are still dropped.
     */
    private static final HttpHeaders REDIRECT_HEADER_BLOCKLIST_PRESERVE_BODY = new DefaultHttpHeaders()
        .add(HttpHeaderNames.HOST, "")
        .add(HttpHeaderNames.CONNECTION, "");

    /**
     * When following 3xx responses (that are not 307 or 308) the request bodies are dropped and converted
     * to GET requests. Therefore, headers related to the content and length of the request body must
     * also be stripped along with standard hop-by-hop and host-specific headers.
     */
    private static final HttpHeaders REDIRECT_HEADER_BLOCKLIST = new DefaultHttpHeaders()
        .add(HttpHeaderNames.HOST, "")
        .add(HttpHeaderNames.TRANSFER_ENCODING, "")
        .add(HttpHeaderNames.CONNECTION, "")
        .add(HttpHeaderNames.CONTENT_TYPE, "")
        .add(HttpHeaderNames.CONTENT_LENGTH, "");

    protected MediaTypeCodecRegistry mediaTypeCodecRegistry;
    protected final ByteBufferFactory<ByteBufAllocator, ByteBuf> byteBufferFactory = new NettyByteBufferFactory();

    ConnectionManager connectionManager;

    private MessageBodyHandlerRegistry handlerRegistry;
    private final List<HttpFilterResolver.FilterEntry> clientFilterEntries;
    private final LoadBalancer loadBalancer;
    private final HttpClientConfiguration configuration;
    private final String contextPath;
    private final Charset defaultCharset;
    private final Logger log;
    private final HttpClientFilterResolver<ClientFilterResolutionContext> filterResolver;