Home / Function/ testDecodeMalformedBadCharsetContentDispositionFieldParameters() — netty Function Reference

testDecodeMalformedBadCharsetContentDispositionFieldParameters() — netty Function Reference

Architecture documentation for the testDecodeMalformedBadCharsetContentDispositionFieldParameters() function in HttpPostRequestDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  573a68b8_f83a_a28f_44f4_d105c6865336["testDecodeMalformedBadCharsetContentDispositionFieldParameters()"]
  d3dadcbe_07b1_86dc_3f34_5a56e9d1367e["HttpPostRequestDecoderTest"]
  573a68b8_f83a_a28f_44f4_d105c6865336 -->|defined in| d3dadcbe_07b1_86dc_3f34_5a56e9d1367e
  style 573a68b8_f83a_a28f_44f4_d105c6865336 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java lines 668–697

    @Test
    public void testDecodeMalformedBadCharsetContentDispositionFieldParameters() throws Exception {

        final String boundary = "74e78d11b0214bdcbc2f86491eeb4902";

        final String body = "--" + boundary + "\r\n" +
                "Content-Disposition: form-data; name=\"file\"; filename*=not-a-charset''filename\r\n" +
                "\r\n" +
                "foo\r\n" +
                "\r\n" +
                "--" + boundary + "--";

        final DefaultFullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
                HttpMethod.POST,
                "http://localhost",
                Unpooled.wrappedBuffer(body.getBytes()));

        req.headers().add(HttpHeaderNames.CONTENT_TYPE, "multipart/form-data; boundary=" + boundary);

        final DefaultHttpDataFactory inMemoryFactory = new DefaultHttpDataFactory(false);

        try {
            new HttpPostRequestDecoder(inMemoryFactory, req);
            fail("Was expecting an ErrorDataDecoderException");
        } catch (HttpPostRequestDecoder.ErrorDataDecoderException e) {
            assertTrue(e.getCause() instanceof UnsupportedCharsetException);
        } finally {
            assertTrue(req.release());
        }
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free