Home / Function/ mustRejectImproperlyTerminatedChunkExtensions() — netty Function Reference

mustRejectImproperlyTerminatedChunkExtensions() — netty Function Reference

Architecture documentation for the mustRejectImproperlyTerminatedChunkExtensions() function in HttpRequestDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  830e6f18_123d_b87c_22b1_9f3b1d111c72["mustRejectImproperlyTerminatedChunkExtensions()"]
  514322d5_436a_d1ac_6240_1f9cf42934a4["HttpRequestDecoderTest"]
  830e6f18_123d_b87c_22b1_9f3b1d111c72 -->|defined in| 514322d5_436a_d1ac_6240_1f9cf42934a4
  style 830e6f18_123d_b87c_22b1_9f3b1d111c72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java lines 638–664

    @Test
    void mustRejectImproperlyTerminatedChunkExtensions() throws Exception {
        // See full explanation: https://w4ke.info/2025/06/18/funky-chunks.html
        String requestStr = "GET /one HTTP/1.1\r\n" +
                "Host: localhost\r\n" +
                "Transfer-Encoding: chunked\r\n\r\n" +
                "2;\n" + // Chunk size followed by illegal single newline (not preceded by carraige return)
                "xx\r\n" +
                "45\r\n" +
                "0\r\n\r\n" +
                "GET /two HTTP/1.1\r\n" +
                "Host: localhost\r\n" +
                "Transfer-Encoding: chunked\r\n\r\n" +
                "0\r\n\r\n";
        EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDecoder());
        assertTrue(channel.writeInbound(Unpooled.copiedBuffer(requestStr, CharsetUtil.US_ASCII)));
        HttpRequest request = channel.readInbound();
        assertFalse(request.decoderResult().isFailure()); // We parse the headers just fine.
        assertTrue(request.headers().names().contains("Transfer-Encoding"));
        assertTrue(request.headers().contains("Transfer-Encoding", "chunked", false));
        HttpContent content = channel.readInbound();
        DecoderResult decoderResult = content.decoderResult();
        assertTrue(decoderResult.isFailure()); // But parsing the chunk must fail.
        assertThat(decoderResult.cause()).isInstanceOf(InvalidChunkExtensionException.class);
        content.release();
        assertFalse(channel.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does mustRejectImproperlyTerminatedChunkExtensions() do?
mustRejectImproperlyTerminatedChunkExtensions() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java.
Where is mustRejectImproperlyTerminatedChunkExtensions() defined?
mustRejectImproperlyTerminatedChunkExtensions() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java at line 638.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free