testDecodeMalformedEmptyContentTypeFieldParameters() — netty Function Reference
Architecture documentation for the testDecodeMalformedEmptyContentTypeFieldParameters() function in HttpPostRequestDecoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD de624b8b_a44f_6311_9755_44b8adf2aeba["testDecodeMalformedEmptyContentTypeFieldParameters()"] d3dadcbe_07b1_86dc_3f34_5a56e9d1367e["HttpPostRequestDecoderTest"] de624b8b_a44f_6311_9755_44b8adf2aeba -->|defined in| d3dadcbe_07b1_86dc_3f34_5a56e9d1367e style de624b8b_a44f_6311_9755_44b8adf2aeba fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java lines 700–728
@Test
public void testDecodeMalformedEmptyContentTypeFieldParameters() throws Exception {
final String boundary = "dLV9Wyq26L_-JQxk6ferf-RT153LhOO";
final DefaultFullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST,
"http://localhost");
req.headers().add(HttpHeaderNames.CONTENT_TYPE, "multipart/form-data; boundary=" + boundary);
// Force to use memory-based data.
final DefaultHttpDataFactory inMemoryFactory = new DefaultHttpDataFactory(false);
final String data = "asdf";
final String filename = "tmp-0.txt";
final String body =
"--" + boundary + "\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"" + filename + "\"\r\n" +
"Content-Type: \r\n" +
"\r\n" +
data + "\r\n" +
"--" + boundary + "--\r\n";
req.content().writeBytes(body.getBytes(CharsetUtil.UTF_8));
// Create decoder instance to test.
final HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(inMemoryFactory, req);
assertFalse(decoder.getBodyHttpDatas().isEmpty());
InterfaceHttpData part1 = decoder.getBodyHttpDatas().get(0);
assertTrue(part1 instanceof FileUpload);
FileUpload fileUpload = (FileUpload) part1;
assertEquals("tmp-0.txt", fileUpload.getFilename());
decoder.destroy();
assertTrue(req.release());
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does testDecodeMalformedEmptyContentTypeFieldParameters() do?
testDecodeMalformedEmptyContentTypeFieldParameters() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java.
Where is testDecodeMalformedEmptyContentTypeFieldParameters() defined?
testDecodeMalformedEmptyContentTypeFieldParameters() is defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java at line 700.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free